| Modifier and Type | Field and Description |
|---|---|
| private DataValueDescriptor | |
| private JSQLType | jsqlType
This ParameterNode may turn up as an argument to a replicated Work Unit. |
| private int | |
| private int | |
| private ValueNode | returnOutputParameter
By default, we assume we are just a normal, harmless little ole parameter. |
| private DataTypeDescriptor[] | userParameterTypes
Pointer to the array in the CompilerContext that holds array of types for all the user-visible paramerers.. |
| private ValueNode | valToGenerate
If this parameter node was created as part of a "probe predicate" for an InListOperatorNode then it does not actually correspond to a specific value--we just created it as a start-key place-holder for IN-list values at execution time. |
| Access | Constructor and Description |
|---|---|
| pack-priv | ParameterNode(int
The number of this parameter,
(unique per query starting at 0) parameterNumber, DataValueDescriptor The default value for this parameter defaultValue, ContextManager The context manager cm)Constructor for a ParameterNode. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ValueNode | Returns: The new top of the expression tree.The 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)Overrides org. Bind this expression. |
| pack-priv boolean | constantExpression(PredicateList whereClause)
Overrides org. Return whether or not this expression tree represents a constant value. |
| 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 ParameterNode, we generate for the return value: (<java type name>) ( (BaseActivation) this.getParameter(parameterNumber) ) |
| pack-priv static void | generateParameterValueSet(ExpressionClassBuilder
The ExpressionClassBuilder for the class we're building acb, int number of parameters for this statement numberOfParameters, List<ParameterNode> The parameter list for the statement. parameterList)Generate the code to create the ParameterValueSet, if necessary, when constructing the activation. |
| pack-priv DataValueDescriptor | |
| public JSQLType | Returns: the JSQLType that the remote system assignedGet the JSQLType associated with this parameter. |
| protected int | Returns: The variant type for the underlying expression.Overrides org. Return the variant type for the underlying expression. |
| pack-priv int | |
| pack-priv TypeId | getTypeId()
Overrides org. Get the TypeId from this ValueNode. |
| pack-priv boolean | Returns: Whether or not this expression tree represents a constant expression.Overrides org. Return whether or not this expression tree represents a constant expression. |
| pack-priv boolean | isEquivalent(ValueNode
the node to compare this ValueNode against. o)Implements abstract org. Tests if this node is equivalent to the specified ValueNode. |
| pack-priv boolean | isParameterNode()
Overrides org. Returns TRUE if this is a parameter node. |
| pack-priv boolean | Returns: true if it is a return paramIs this as a return output parameter (e.g. ? |
| pack-priv boolean | requiresTypeFromContext()
Overrides org. Returns TRUE if the type of this node will be determined from the context in which it is getting used. |
| pack-priv void | setDescriptors(DataTypeDescriptor[]
The array of DataTypeServices to fill in when the parameters
are bound. descriptors)Set the descriptor array |
| public void | setJSQLType(JSQLType
the JSQLType associated with this parameter type)Set the JSQLType of this parameter. |
| pack-priv void | setOrderableVariantType(int type)
In a special circumstance, we want to consider parameters as constants. |
| pack-priv void | |
| pack-priv void | setType(DataTypeDescriptor
The DataTypeServices to set for this parameter descriptor)Overrides org. Set the DataTypeServices for this parameter |
| protected void | setValueToGenerate(ValueNode
The ValueNode to generate in place of this ParameterNode. vn)Save the received ValueNode locally so that we can generate it (in place of "this") at generation time. |
| defaultValue | back to summary |
|---|---|
| private DataValueDescriptor defaultValue | |
| jsqlType | back to summary |
|---|---|
| private JSQLType jsqlType This ParameterNode may turn up as an argument to a replicated Work Unit. If so, the remote system will have figured out the type of this node. That's what this variable is for. | |
| orderableVariantType | back to summary |
|---|---|
| private int orderableVariantType | |
| parameterNumber | back to summary |
|---|---|
| private int parameterNumber | |
| returnOutputParameter | back to summary |
|---|---|
| private ValueNode returnOutputParameter By default, we assume we are just a normal, harmless little ole parameter. But sometimes we may be a return parameter (e.g. ? = CALL myMethod()). | |
| userParameterTypes | back to summary |
|---|---|
| private DataTypeDescriptor[] userParameterTypes Pointer to the array in the CompilerContext that holds array of types for all the user-visible paramerers.. When each parameter is bound, it fills in its type descriptor in this array. Note that the array is allocated in the parser, but the individual elements are not filled in until their corresponding parameters are bound. This array is not read in this class, but is read from the CompilerContext on completion of compiling the statement. In some case a parameter node may exist but is not a visble user parameter, in this case typeServices will be null so that setting its type will not modify the user's set. | |
| valToGenerate | back to summary |
|---|---|
| private ValueNode valToGenerate If this parameter node was created as part of a "probe predicate" for an InListOperatorNode then it does not actually correspond to a specific value--we just created it as a start-key place-holder for IN-list values at execution time. In order to serve that purpose we need to generate some value that can be used as the place-holder. Since this parameter node is "fake" and does not correspond to an actual parameter, we can't really generate it; so the following field holds some legitimate ValueNode--either a constant node or a "real" parameter node--that we can generate to serve as the place-holder. | |
| ParameterNode | back to summary |
|---|---|
| pack-priv ParameterNode(int parameterNumber, DataValueDescriptor defaultValue, ContextManager cm) Constructor for a ParameterNode.
| |
| bindExpression | back to summary |
|---|---|
| pack-priv ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException Overrides org. Bind this expression. A parameter can't figure out what its type is without knowing where it appears, so this method does nothing. It is up to the node that points to this parameter node to figure out the type of the parameter and set it, using the setType() method above.
| |
| constantExpression | back to summary |
|---|---|
| pack-priv boolean constantExpression(PredicateList whereClause) Overrides org. Doc from org. Return whether or not this expression tree represents a constant value. In this case, "constant" means that it will always evaluate to the same thing, even if it includes columns. A column is constant if it is compared to a constant expression.
| |
| generateExpression | back to summary |
|---|---|
| pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException Overrides org. For a ParameterNode, we generate for the return value:
( The ExpressionClassBuilder for the class being built
The method the expression will go into
| |
| generateParameterValueSet | back to summary |
|---|---|
| pack-priv static void generateParameterValueSet(ExpressionClassBuilder acb, int numberOfParameters, List<ParameterNode> parameterList) throws StandardException Generate the code to create the ParameterValueSet, if necessary, when constructing the activation. Also generate the code to call a method that will throw an exception if we try to execute without all the parameters being set. This generated code goes into the Activation's constructor early on.
| |
| getDefaultValue | back to summary |
|---|---|
| pack-priv DataValueDescriptor getDefaultValue() Get the default value for the parameter. Parameters may get default values for optimization purposes.
| |
| getJSQLType | back to summary |
|---|---|
| public JSQLType getJSQLType() Get the JSQLType associated with this parameter. Again, part of method resolution for replicated work units.
| |
| getOrderableVariantType | back to summary |
|---|---|
| protected int getOrderableVariantType() 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)
| |
| getParameterNumber | back to summary |
|---|---|
| pack-priv int getParameterNumber() Get the parameter number
| |
| getTypeId | back to summary |
|---|---|
| pack-priv TypeId getTypeId() throws StandardException Overrides org. Doc from org. Get the TypeId from this ValueNode. | |
| isConstantExpression | back to summary |
|---|---|
| pack-priv boolean isConstantExpression() Overrides org. Return whether or not this expression tree represents a constant expression.
| |
| isEquivalent | back to summary |
|---|---|
| pack-priv boolean isEquivalent(ValueNode o) Implements abstract org. Doc from org. Tests if this node is equivalent to the specified ValueNode. Two ValueNodes are considered equivalent if they will evaluate to the same value during query execution. This method provides basic expression matching facility for the derived class of ValueNode and it is used by the language layer to compare the node structural form of the two expressions for equivalence at bind phase. Note that it is not comparing the actual row values at runtime to produce a result; hence, when comparing SQL NULLs, they are considered to be equivalent and not unknown. One usage case of this method in this context is to compare the select column expression against the group by expression to check if they are equivalent. e.g.: SELECT c1+c2 FROM t1 GROUP BY c1+c2 In general, node equivalence is determined by the derived class of ValueNode. But they generally abide to the rules below:
| |
| isParameterNode | back to summary |
|---|---|
| pack-priv boolean isParameterNode() Overrides org. Doc from org. Returns TRUE if this is a parameter node. We do lots of special things with Parameter Nodes.
| |
| isReturnOutputParam | back to summary |
|---|---|
| pack-priv boolean isReturnOutputParam() Is this as a return output parameter (e.g. ? = CALL myMethod())
| |
| requiresTypeFromContext | back to summary |
|---|---|
| pack-priv boolean requiresTypeFromContext() Overrides org. Doc from org. Returns TRUE if the type of this node will be determined from the context in which it is getting used. If true is returned then after bindExpression() is called on the node, its type must be set (from the relevant context) using setType().
| |
| setDescriptors | back to summary |
|---|---|
| pack-priv void setDescriptors(DataTypeDescriptor[] descriptors) Set the descriptor array
| |
| setJSQLType | back to summary |
|---|---|
| public void setJSQLType(JSQLType type) Set the JSQLType of this parameter. This supports the unnamed parameters that we use for replicated work units.
| |
| setOrderableVariantType | back to summary |
|---|---|
| pack-priv void setOrderableVariantType(int type) In a special circumstance, we want to consider parameters as constants. For that situation, we allow a caller to temporarily set us to CONSTANT and then restore us. | |
| setReturnOutputParam | back to summary |
|---|---|
| pack-priv void setReturnOutputParam(ValueNode valueNode) Mark this as a return output parameter (e.g. ? = CALL myMethod()) | |
| setType | back to summary |
|---|---|
| pack-priv void setType(DataTypeDescriptor descriptor) throws StandardException Overrides org. Set the DataTypeServices for this parameter
| |
| setValueToGenerate | back to summary |
|---|---|
| protected void setValueToGenerate(ValueNode vn) Save the received ValueNode locally so that we can generate it (in place of "this") at generation time. See the preprocess() method of InListOperatorNode for more on how this is used.
| |