Modifier and Type | Field and Description |
---|---|
private DataValueDescriptor |
defaultValue |
private JSQLType |
jsqlType
This ParameterNode may turn up as an argument to a replicated Work Unit.
|
private int |
orderableVariantType |
private int |
parameterNumber |
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.
|
transformed
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
ParameterNode(int parameterNumber,
DataValueDescriptor defaultValue,
ContextManager cm)
Constructor for a ParameterNode.
|
Modifier and Type | Method and Description |
---|---|
(package private) ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List<AggregateNode> aggregates)
Bind this expression.
|
(package private) boolean |
constantExpression(PredicateList whereClause)
Return whether or not this expression tree represents a constant value.
|
(package private) void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
For a ParameterNode, we generate for the return value:
(
|
(package private) static void |
generateParameterValueSet(ExpressionClassBuilder acb,
int numberOfParameters,
java.util.List<ParameterNode> parameterList)
Generate the code to create the ParameterValueSet, if necessary,
when constructing the activation.
|
(package private) DataValueDescriptor |
getDefaultValue()
Get the default value for the parameter.
|
JSQLType |
getJSQLType()
Get the JSQLType associated with this parameter.
|
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression.
|
(package private) int |
getParameterNumber()
Get the parameter number
|
(package private) TypeId |
getTypeId()
Get the TypeId from this ValueNode.
|
(package private) boolean |
isConstantExpression()
Return whether or not this expression tree represents a constant expression.
|
(package private) boolean |
isEquivalent(ValueNode o)
Tests if this node is equivalent to the specified ValueNode.
|
(package private) boolean |
isParameterNode()
Returns TRUE if this is a parameter node.
|
(package private) boolean |
isReturnOutputParam()
Is this as a return output parameter (e.g.
?
|
(package private) boolean |
requiresTypeFromContext()
Returns TRUE if the type of this node will be determined from the
context in which it is getting used.
|
(package private) void |
setDescriptors(DataTypeDescriptor[] descriptors)
Set the descriptor array
|
void |
setJSQLType(JSQLType type)
Set the JSQLType of this parameter.
|
(package private) void |
setOrderableVariantType(int type)
In a special circumstance, we want to consider
parameters as constants.
|
(package private) void |
setReturnOutputParam(ValueNode valueNode)
Mark this as a return output parameter (e.g.
?
|
(package private) void |
setType(DataTypeDescriptor descriptor)
Set the DataTypeServices for this parameter
|
protected void |
setValueToGenerate(ValueNode vn)
Save the received ValueNode locally so that we can generate it
(in place of "this") at generation time.
|
bindExpression, categorize, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isRelationalOperator, isSameNodeKind, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, toString, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
accept, acceptChildren, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
private int parameterNumber
private DataTypeDescriptor[] userParameterTypes
private DataValueDescriptor defaultValue
private JSQLType jsqlType
private int orderableVariantType
private ValueNode returnOutputParameter
private ValueNode valToGenerate
ParameterNode(int parameterNumber, DataValueDescriptor defaultValue, ContextManager cm)
parameterNumber
- The number of this parameter,
(unique per query starting at 0)defaultValue
- The default value for this parametercm
- The context managerint getParameterNumber()
void setDescriptors(DataTypeDescriptor[] descriptors)
descriptors
- The array of DataTypeServices to fill in when the parameters
are bound.void setType(DataTypeDescriptor descriptor) throws StandardException
setType
in class ValueNode
descriptor
- The DataTypeServices to set for this parameterStandardException
void setReturnOutputParam(ValueNode valueNode)
boolean isReturnOutputParam()
ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) throws StandardException
bindExpression
in class ValueNode
fromList
- The FROM list for the query this
expression is in, for binding columns.subqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodesStandardException
- Thrown on errorboolean isConstantExpression()
isConstantExpression
in class ValueNode
boolean constantExpression(PredicateList whereClause)
ValueNode
constantExpression
in class ValueNode
ValueNode.constantExpression(org.apache.derby.impl.sql.compile.PredicateList)
protected int getOrderableVariantType()
getOrderableVariantType
in class ValueNode
void setOrderableVariantType(int type)
public void setJSQLType(JSQLType type)
type
- the JSQLType associated with this parameterpublic JSQLType getJSQLType()
void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression
in class ValueNode
acb
- The ExpressionClassBuilder for the class being builtmb
- The method the expression will go intoStandardException
- Thrown on errorTypeId getTypeId() throws StandardException
ValueNode
getTypeId
in class ValueNode
StandardException
static void generateParameterValueSet(ExpressionClassBuilder acb, int numberOfParameters, java.util.List<ParameterNode> parameterList) throws StandardException
acb
- The ExpressionClassBuilder for the class we're buildingnumberOfParameters
- number of parameters for this statementparameterList
- The parameter list for the statement.StandardException
- on errorDataValueDescriptor getDefaultValue()
boolean requiresTypeFromContext()
ValueNode
requiresTypeFromContext
in class ValueNode
ValueNode.requiresTypeFromContext()
boolean isParameterNode()
ValueNode
isParameterNode
in class ValueNode
ValueNode.isParameterNode()
boolean isEquivalent(ValueNode o)
ValueNode
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:
isEquivalent
in class ValueNode
o
- the node to compare this ValueNode against.true
if the two nodes are equivalent,
false
otherwise.protected void setValueToGenerate(ValueNode vn)
vn
- The ValueNode to generate in place of this ParameterNode.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.