| Modifier and Type | Field and Description |
|---|---|
| pack-priv LocalField | returnsNullOnNullState
If set then this SQL value is being passed into a SQL function declared RETURNS NULL ON NULL input. |
| pack-priv ValueNode |
| Access | Constructor and Description |
|---|---|
| pack-priv | SQLToJavaValueNode(ValueNode
A ValueNode representing a SQL value to convert to
the Java domain. value, ContextManager The context manager cm)Constructor for a SQLToJavaValueNode |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | acceptChildren(Visitor
the visitor v)Overrides org. Accept the visitor for all visitable children of this node. |
| pack-priv JavaValueNode | Returns: thisThe FROM list for the query this
expression is in, for binding columns. fromList, SubqueryList The subquery list being built as we find
SubqueryNodes subqueryList, List<AggregateNode> The aggregate list being built as we find AggregateNodes aggregates)Implements abstract org. Bind this expression. |
| pack-priv boolean | Returns: boolean Whether or not source.expression is a ColumnReference or a VirtualColumnNode.JBitSet with bit map of referenced FromTables referencedTabs, boolean Whether or not to consider method
calls, field references and conditional nodes
when building bit map simplePredsOnly)Implements abstract org. Categorize this predicate. |
| pack-priv void | generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The method the expression will go into mb)Implements abstract org. Generate code to get the Java value out of a SQL value. |
| private void | generateJavaValue(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The method the expression will go into mbex)Generate code to cast the SQLValue to a Java value. |
| private void | generateReturnsNullOnNullCheck(MethodBuilder mb)
Generate the code for the returns Null on Null input check.. |
| private void | generateSQLValue(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The method the expression will go into mb)Generate the SQLvalue that this node wraps. |
| pack-priv Object | |
| pack-priv DataTypeDescriptor | getDataType()
Overrides org. Get the resolved data type of this node. |
| pack-priv String | Returns: name of java class typeOverrides org. Returns the name of the java class type that this node coerces to. |
| pack-priv JSQLType | Returns: the corresponding JSQLTypeOverrides org. Get the JSQLType that corresponds to this node. |
| pack-priv int | Returns: The variant type for the underlying expression.Overrides org. Return the variant type for the underlying expression. |
| pack-priv String | Returns: name of java primitive typeOverrides org. Returns the name of the java primitive type that this node coerces to. |
| private String | Returns: name of interface corresponding to SQLValueGet the type name of the SQLValue we generate. |
| pack-priv ValueNode | Returns: The underlying SQL ValueNodeGet the SQL ValueNode that is being converted to a JavaValueNode |
| pack-priv void | preprocess(int
Number of tables in the DML Statement numTables, FromList FromList from outer query block outerFromList, SubqueryList SubqueryList from outer query block outerSubqueryList, PredicateList PredicateList from outer query block outerPredicateList)Implements abstract org. Preprocess an expression tree. |
| pack-priv void | printSubNodes(int
The depth of this node in the tree depth)Overrides org. Prints the sub-nodes of this object. |
| pack-priv JavaValueNode | Returns: JavaValueNode The remapped expression tree.Implements abstract org. Remap all ColumnReferences in this tree to be clones of the underlying expression. |
| returnsNullOnNullState | back to summary |
|---|---|
| pack-priv LocalField returnsNullOnNullState If set then this SQL value is being passed into a SQL function declared RETURNS NULL ON NULL input. In this case this node performs NULL checking logic in addition simple translation from the SQL domain to the Java domain. Thus if this is set then this node can not be removed when it is paired with a JavaToSQLValueNode. This field is set at generate time of the enclosing StaticMethodCallNode. | |
| value | back to summary |
|---|---|
| pack-priv ValueNode value | |
| SQLToJavaValueNode | back to summary |
|---|---|
| pack-priv SQLToJavaValueNode(ValueNode value, ContextManager cm) Constructor for a SQLToJavaValueNode
| |
| acceptChildren | back to summary |
|---|---|
| pack-priv void acceptChildren(Visitor v) throws StandardException Overrides org. Accept the visitor for all visitable children of this node.
| |
| bindExpression | back to summary |
|---|---|
| pack-priv JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException Implements abstract org. Bind this expression. This means binding the sub-expressions, as well as figuring out what the return type is for this expression.
| |
| categorize | back to summary |
|---|---|
| pack-priv boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException Implements abstract org. Categorize this predicate. Initially, this means building a bit map of the referenced tables for each predicate. If the source of this ColumnReference (at the next underlying level) is not a ColumnReference or a VirtualColumnNode then this predicate will not be pushed down. For example, in: select * from (select 1 from s) a (x) where x = 1 we will not push down x = 1. Note It would be easy to handle the case of a constant, but if the inner SELECT returns an arbitrary expression, then we would have to copy that tree into the pushed predicate, and that tree could contain subqueries and method calls. RESOLVE - revisit this issue once we have views.
| |
| generateExpression | back to summary |
|---|---|
| pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException Implements abstract org. Generate code to get the Java value out of a SQL value.
Every SQL type has a corresponding Java type. The getObject() method
on the SQL type gets the right Java type.
The generated code will be:
( The ExpressionClassBuilder for the class being built
The method the expression will go into
| |
| generateJavaValue | back to summary |
|---|---|
| private void generateJavaValue(ExpressionClassBuilder acb, MethodBuilder mbex) throws StandardException Generate code to cast the SQLValue to a Java value.
| |
| generateReturnsNullOnNullCheck | back to summary |
|---|---|
| private void generateReturnsNullOnNullCheck(MethodBuilder mb) Generate the code for the returns Null on Null input check.. Stack must contain the DataDescriptorValue. | |
| generateSQLValue | back to summary |
|---|---|
| private void generateSQLValue(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException Generate the SQLvalue that this node wraps.
| |
| getConstantValueAsObject | back to summary |
|---|---|
| pack-priv Object getConstantValueAsObject() throws StandardException Overrides org.
| |
| getDataType | back to summary |
|---|---|
| pack-priv DataTypeDescriptor getDataType() throws StandardException Overrides org. Doc from org. Get the resolved data type of this node. May be overridden by descendants.
| |
| getJavaTypeName | back to summary |
|---|---|
| pack-priv String getJavaTypeName() throws StandardException Overrides org. Returns the name of the java class type that this node coerces to. | |
| getJSQLType | back to summary |
|---|---|
| pack-priv JSQLType getJSQLType() throws StandardException Overrides org. Get the JSQLType that corresponds to this node. Could be a SQLTYPE, a Java primitive, or a Java class. Overrides method in JavaValueNode. | |
| getOrderableVariantType | back to summary |
|---|---|
| pack-priv int getOrderableVariantType() throws StandardException Overrides org. Return the variant type for the underlying expression. The variant type can be: VARIANT - variant within a scan (method calls and non-static field access) SCAN_INVARIANT - invariant within a scan (column references from outer tables) QUERY_INVARIANT - invariant within the life of a query (constant expressions)
| |
| getPrimitiveTypeName | back to summary |
|---|---|
| pack-priv String getPrimitiveTypeName() throws StandardException Overrides org. Returns the name of the java primitive type that this node coerces to.
| |
| getSQLValueInterfaceName | back to summary |
|---|---|
| private String getSQLValueInterfaceName() throws StandardException Get the type name of the SQLValue we generate.
| |
| getSQLValueNode | back to summary |
|---|---|
| pack-priv ValueNode getSQLValueNode() Get the SQL ValueNode that is being converted to a JavaValueNode
| |
| preprocess | back to summary |
|---|---|
| pack-priv void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException Implements abstract org. Preprocess an expression tree. We do a number of transformations here (including subqueries, IN lists, LIKE and BETWEEN) plus subquery flattening. Note This is done before the outer ResultSetNode is preprocessed.
| |
| printSubNodes | back to summary |
|---|---|
| pack-priv void printSubNodes(int depth) Overrides org. Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.
| |
| remapColumnReferencesToExpressions | back to summary |
|---|---|
| pack-priv JavaValueNode remapColumnReferencesToExpressions() throws StandardException Implements abstract org. Remap all ColumnReferences in this tree to be clones of the underlying expression.
| |