| Modifier and Type | Field and Description |
|---|---|
| pack-priv Object |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv | |
| pack-priv | |
| pack-priv | UserTypeConstantNode(DataValueDescriptor
Must contain a Date, Time or Timestamp value dvd, ContextManager context manager cm)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | generateConstant(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The method the expression will go into mb)Implements abstract org. Should never be called for UserTypeConstantNode because we have our own generateExpression(). |
| pack-priv void | generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The method the expression will go into mb)Overrides org. For a UserTypeConstantNode, we have to store away the object somewhere and have a way to get it back at runtime. |
| pack-priv Object | Returns: An Object representing the bind time value of this expression tree. (null if not a bind time constant.)Overrides org. Return an Object representing the bind time value of this expression tree. |
| public Object | Returns: the value of this constant. can't use getValue() for this. getValue() returns the DataValueDescriptor for the built-in types that are implemented as user types (date, time, timestamp)Return the object value of this user defined type. |
| private static TypeId | |
| private static int | |
| pack-priv boolean | isNull()
Overrides org. Return whether or not this node represents a typed null constant. |
| val | back to summary |
|---|---|
| pack-priv Object val | |
| UserTypeConstantNode | back to summary |
|---|---|
| pack-priv UserTypeConstantNode(TypeId t, ContextManager cm) throws StandardException | |
| UserTypeConstantNode | back to summary |
|---|---|
| pack-priv UserTypeConstantNode(Date d, ContextManager cm) throws StandardException | |
| UserTypeConstantNode | back to summary |
|---|---|
| pack-priv UserTypeConstantNode(Time t, ContextManager cm) throws StandardException | |
| UserTypeConstantNode | back to summary |
|---|---|
| pack-priv UserTypeConstantNode(Timestamp t, ContextManager cm) throws StandardException | |
| UserTypeConstantNode | back to summary |
|---|---|
pack-priv UserTypeConstantNode(DataValueDescriptor dvd, ContextManager cm) throws StandardException
| |
| generateConstant | back to summary |
|---|---|
| pack-priv void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException Implements abstract org. Should never be called for UserTypeConstantNode because we have our own generateExpression().
| |
| generateExpression | back to summary |
|---|---|
| pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException Overrides org. For a UserTypeConstantNode, we have to store away the object somewhere and have a way to get it back at runtime. These objects are serializable. This gives us at least two options: 1) serialize it out into a byte array field, and serialize it back in when needed, from the field. 2) have an array of objects in the prepared statement and a #, to find the object directly. Because it is serializable, it will store with the rest of the executable just fine. Choice 2 gives better performance -- the ser/deser cost is paid on database access for the statement, not for each execution of it. However, it requires some infrastructure support from prepared statements. For now, we take choice 3, and make some assumptions about available methods on the user type. This choice has the shortcoming that it will not work for arbitrary user types. REVISIT and implement choice 2 when a general solution is needed. A null is generated as a Null value cast to the type of the constant node.
| |
| getConstantValueAsObject | back to summary |
|---|---|
| pack-priv Object getConstantValueAsObject() Overrides org. Return an Object representing the bind time value of this expression tree. If the expression tree does not evaluate to a constant at bind time then we return null. This is useful for bind time resolution of VTIs. Resolve What do we do for primitives? | |
| getObjectValue | back to summary |
|---|---|
| public Object getObjectValue() Return the object value of this user defined type.
| |
| getTypeId | back to summary |
|---|---|
| private static TypeId getTypeId(DataValueDescriptor dvd) | |
| getWidth | back to summary |
|---|---|
| private static int getWidth(DataValueDescriptor dvd) | |
| isNull | back to summary |
|---|---|
| pack-priv boolean isNull() Overrides org. Return whether or not this node represents a typed null constant.
| |