|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.QueryTreeNodeVector
org.apache.derby.impl.sql.compile.ValueNodeList
public class ValueNodeList
A ValueNodeList represents a list of ValueNodes within a specific predicate (eg, IN list, NOT IN list or BETWEEN) in a DML statement. It extends QueryTreeNodeVector.
Field Summary |
---|
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
Constructor Summary | |
---|---|
ValueNodeList()
|
Method Summary | |
---|---|
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.Vector 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. |
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector |
---|
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, nondestructiveAppend, printSubNodes, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ValueNodeList()
Method Detail |
---|
public void addValueNode(ValueNode valueNode) throws StandardException
valueNode
- A ValueNode to add to the list
StandardException
- Thrown on errorpublic void bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector 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 AggregateNodes
StandardException
- 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) throws StandardException
precedence
- The specified precedence.
StandardException
public void compatible(ValueNode leftOperand) throws StandardException
leftOperand
- Check for compatibility against this parameter's type
StandardException
public void comparable(ValueNode leftOperand) throws StandardException
leftOperand
- The left side of the expression
StandardException
- 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 parameters
StandardException
- 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 block
StandardException
- Thrown on errorpublic ValueNodeList remapColumnReferencesToExpressions() throws StandardException
StandardException
- Thrown on errorboolean isEquivalent(ValueNodeList other) throws StandardException
other
- the other list
true
if the two lists contain equivalent elements, or
false
otherwise
StandardException
- thrown on errorValueNode.isEquivalent(ValueNode)
public boolean isConstantExpression()
public boolean constantExpression(PredicateList whereClause)
ValueNode.constantExpression(org.apache.derby.impl.sql.compile.PredicateList)
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 map
StandardException
- Thrown on errorprotected int getOrderableVariantType() throws StandardException
StandardException
- thrown on error
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |