public class ValueNodeList extends QueryTreeNodeVector
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
ValueNodeList() |
Modifier and Type | Method and Description |
---|---|
void |
addValueNode(ValueNode valueNode)
Add a ValueNode to the list.
|
(package private) boolean |
allSamePrecendence(int precedence)
Return whether or not all of the entries in the list have the same
type precendence as the specified value.
|
void |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List aggregateVector)
Bind this expression.
|
boolean |
categorize(JBitSet referencedTabs,
boolean simplePredsOnly)
Categorize this predicate.
|
void |
comparable(ValueNode leftOperand)
Determine whether or not the leftOperand is comparable() with all of
the elements in the list.
|
void |
compatible(ValueNode leftOperand)
Make sure that passed ValueNode's type is compatible with the non-parameter elements in the ValueNodeList.
|
boolean |
constantExpression(PredicateList whereClause) |
boolean |
containsAllConstantNodes()
Does this list contain all ConstantNodes?
|
boolean |
containsAllParameterNodes()
Does this list contain all ParameterNodes?
|
boolean |
containsOnlyConstantAndParamNodes()
Does this list *only* contain constant and/or parameter nodes?
|
boolean |
containsParameterNode()
Does this list contain a ParameterNode?
|
void |
genSQLJavaSQLTrees()
Generate a SQL->Java->SQL conversion tree any node in the list
which is not a system built-in type.
|
DataTypeDescriptor |
getDominantTypeServices()
Get the dominant DataTypeServices from the elements in the list.
|
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression.
|
DataTypeDescriptor |
getTypeServices()
Get the first non-null DataTypeServices from the elements in the list.
|
boolean |
isConstantExpression()
Return whether or not this expression tree represents a constant expression.
|
(package private) boolean |
isEquivalent(ValueNodeList other)
Check if all the elements in this list are equivalent to the elements
in another list.
|
boolean |
isNullable()
Determine whether or not any of the elements in the list are nullable.
|
void |
preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
Preprocess a ValueNodeList.
|
ValueNodeList |
remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the
underlying expression.
|
void |
setParameterDescriptor(DataTypeDescriptor descriptor)
Set the descriptor for every ParameterNode in the list.
|
(package private) void |
sortInAscendingOrder(DataValueDescriptor judgeODV)
Sort the entries in the list in ascending order.
|
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, nondestructiveAppend, printSubNodes, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size
accept, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, toString, treePrint, treePrint, verifyClassExist
public void addValueNode(ValueNode valueNode) throws StandardException
valueNode
- A ValueNode to add to the listStandardException
- Thrown on errorpublic void bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List aggregateVector) throws StandardException
fromList
- The FROM list for the query this
expression is in, for binding columns.subqueryList
- The subquery list being built as we find SubqueryNodesaggregateVector
- The aggregate vector being built as we find AggregateNodesStandardException
- Thrown on errorpublic void genSQLJavaSQLTrees() throws StandardException
StandardException
- Thrown on errorpublic DataTypeDescriptor getDominantTypeServices() throws StandardException
StandardException
- Thrown on errorWith that algorithm, if one DTD has collation derivation of NONE and the
other DTD has collation derivation of IMPLICIT, then the return DTD from
DTD.getDominantType will have collation derivation of IMPLICIT. That is
not the correct algorithm for aggregate operators. SQL standards says
that if EVERY type has implicit derivation AND is of the same type, then
the collation of the resultant will be of that type with derivation
IMPLICIT. To provide this behavior for aggregate operator, we basically
ignore the collation type and derivation picked by
DataTypeDescriptor.getDominantType. Instead we let
getDominantTypeServices use the simple algorithm listed at the top of
this method's comments to determine the collation type and derivation
for this ValueNodeList object.
public DataTypeDescriptor getTypeServices() throws StandardException
StandardException
- Thrown on errorboolean allSamePrecendence(int precedence)
precedence
- The specified precedence.public void compatible(ValueNode leftOperand) throws StandardException
leftOperand
- Check for compatibility against this parameter's typeStandardException
public void comparable(ValueNode leftOperand) throws StandardException
leftOperand
- The left side of the expressionStandardException
- Thrown on errorpublic boolean isNullable() throws StandardException
StandardException
public boolean containsParameterNode()
public boolean containsAllParameterNodes()
public boolean containsAllConstantNodes()
public boolean containsOnlyConstantAndParamNodes()
void sortInAscendingOrder(DataValueDescriptor judgeODV) throws StandardException
judgeODV
- In case of type not exactly matching, the judging type.StandardException
- Thrown on errorpublic void setParameterDescriptor(DataTypeDescriptor descriptor) throws StandardException
descriptor
- The DataTypeServices to set for the parametersStandardException
- Thrown on errorpublic void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
numTables
- Number of tables in the DML StatementouterFromList
- FromList from outer query blockouterSubqueryList
- SubqueryList from outer query blockouterPredicateList
- PredicateList from outer query blockStandardException
- Thrown on errorpublic ValueNodeList remapColumnReferencesToExpressions() throws StandardException
StandardException
- Thrown on errorboolean isEquivalent(ValueNodeList other) throws StandardException
other
- the other listtrue
if the two lists contain equivalent elements, or
false
otherwiseStandardException
- thrown on errorValueNode.isEquivalent(ValueNode)
public boolean isConstantExpression()
public boolean constantExpression(PredicateList whereClause)
public boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException
referencedTabs
- JBitSet with bit map of referenced FromTablessimplePredsOnly
- Whether or not to consider method
calls, field references and conditional nodes
when building bit mapStandardException
- Thrown on errorprotected int getOrderableVariantType() throws StandardException
StandardException
- thrown on errorApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.