org.apache.derby.impl.sql.compile
Class BetweenOperatorNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.BinaryListOperatorNode
org.apache.derby.impl.sql.compile.BetweenOperatorNode
- All Implemented Interfaces:
- Visitable
- public class BetweenOperatorNode
- extends BinaryListOperatorNode
A BetweenOperatorNode represents a BETWEEN clause. The between values are
represented as a 2 element list in order to take advantage of code reuse.
- Author:
- Jerry Brenner
Methods inherited from class org.apache.derby.impl.sql.compile.BinaryListOperatorNode |
accept, bindComparisonOperator, bindExpression, categorize, constantExpression, getLeftOperand, getOrderableVariantType, getRightOperandList, init, isConstantExpression, printSubNodes, remapColumnReferencesToExpressions, setClause, setLeftOperand, setRightOperandList, toString |
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode |
bindExpression, changeToCNF, checkIsBoolean, checkReliability, checkReliability, checkTopPredicatesForEqualsConditions, copyFields, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClause, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isParameterNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, selectivity, setDescriptor, setTransformed, setType, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop |
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, referencesSessionSchema, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BetweenOperatorNode
public BetweenOperatorNode()
init
public void init(java.lang.Object leftOperand,
java.lang.Object betweenValues)
- Initializer for a BetweenOperatorNode
- Overrides:
init
in class QueryTreeNode
- Parameters:
leftOperand
- The left operand of the nodebetweenValues
- The between values in list form
eliminateNots
ValueNode eliminateNots(boolean underNotNode)
throws StandardException
- Eliminate NotNodes in the current query block. We traverse the tree,
inverting ANDs and ORs and eliminating NOTs as we go. We stop at
ComparisonOperators and boolean expressions. We invert
ComparisonOperators and replace boolean expressions with
boolean expression = false.
NOTE: Since we do not recurse under ComparisonOperators, there
still could be NotNodes left in the tree.
- Overrides:
eliminateNots
in class ValueNode
- Parameters:
underNotNode
- Whether or not we are under a NotNode.
- Returns:
- The modified expression
- Throws:
StandardException
- Thrown on error
preprocess
public ValueNode preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
throws StandardException
- 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.
- Overrides:
preprocess
in class BinaryListOperatorNode
- Parameters:
numTables
- Number of tables in the DML StatementouterFromList
- FromList from outer query blockouterSubqueryList
- SubqueryList from outer query blockouterPredicateList
- PredicateList from outer query block
- Returns:
- The modified expression
- Throws:
StandardException
- Thrown on error
generateExpression
public void generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
throws StandardException
- Do code generation for this BETWEEN operator.
- Overrides:
generateExpression
in class ValueNode
- Parameters:
acb
- The ExpressionClassBuilder for the class we're generatingmb
- The method the code to place the code
- Throws:
StandardException
- Thrown on error
Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.