Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class BetweenOperatorNode

extends BinaryListOperatorNode
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.sanity.SanityManager

A BetweenOperatorNode represents a BETWEEN clause. The between values are represented as a 2 element list in order to take advantage of code reuse.

Field Summary

Inherited from org.apache.derby.impl.sql.compile.BinaryListOperatorNode:
leftOperandmethodNameoperatorrightOperandList

Constructor Summary

AccessConstructor and Description
pack-priv
BetweenOperatorNode(ValueNode
The left operand of the node
leftOperand
,
ValueNodeList
The between values in list form
betweenValues
,
ContextManager cm)

Method Summary

Modifier and TypeMethod and Description
pack-priv ValueNode

Returns:

The modified expression
eliminateNots
(boolean
Whether or not we are under a NotNode.
underNotNode
)

Overrides org.apache.derby.impl.sql.compile.ValueNode.eliminateNots.

Eliminate NotNodes in the current query block.

pack-priv void
generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class we're generating
acb
,
MethodBuilder
The method the code to place the code
mb
)

Overrides org.apache.derby.impl.sql.compile.ValueNode.generateExpression.

Do code generation for this BETWEEN operator.

pack-priv ValueNode

Returns:

The modified expression
preprocess
(int
Number of tables in the DML Statement
numTables
,
FromList
FromList from outer query block
outerFromList
,
SubqueryList
SubqueryList from outer query block
outerSubqueryList
,
PredicateList
PredicateList from outer query block
outerPredicateList
)

Overrides org.apache.derby.impl.sql.compile.BinaryListOperatorNode.preprocess.

Preprocess an expression tree.

private static ValueNodeList
vetValues(ValueNodeList betweenValues)

Inherited from org.apache.derby.impl.sql.compile.BinaryListOperatorNode:
acceptChildrenbindComparisonOperatorbindExpressioncategorizeconstantExpressiongetLeftOperandgetOrderableVariantTypegetRightOperandListisConstantExpressionisEquivalentprintSubNodesremapColumnReferencesToExpressionssetLeftOperandsetRightOperandListtoString

Constructor Detail

BetweenOperatorNodeback to summary
pack-priv BetweenOperatorNode(ValueNode leftOperand, ValueNodeList betweenValues, ContextManager cm) throws StandardException
Parameters
leftOperand:ValueNode

The left operand of the node

betweenValues:ValueNodeList

The between values in list form

Method Detail

eliminateNotsback to summary
pack-priv ValueNode eliminateNots(boolean underNotNode) throws StandardException

Overrides org.apache.derby.impl.sql.compile.ValueNode.eliminateNots.

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.

Parameters
underNotNode:boolean

Whether or not we are under a NotNode.

Returns:ValueNode

The modified expression

Annotations
@Override
Exceptions
StandardException:
Thrown on error
generateExpressionback to summary
pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

Overrides org.apache.derby.impl.sql.compile.ValueNode.generateExpression.

Do code generation for this BETWEEN operator.

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class we're generating

mb:MethodBuilder

The method the code to place the code

Annotations
@Override
Exceptions
StandardException:
Thrown on error
preprocessback to summary
pack-priv ValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException

Overrides org.apache.derby.impl.sql.compile.BinaryListOperatorNode.preprocess.

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.

Parameters
numTables:int

Number of tables in the DML Statement

outerFromList:FromList

FromList from outer query block

outerSubqueryList:SubqueryList

SubqueryList from outer query block

outerPredicateList:PredicateList

PredicateList from outer query block

Returns:ValueNode

The modified expression

Annotations
@Override
Exceptions
StandardException:
Thrown on error
vetValuesback to summary
private static ValueNodeList vetValues(ValueNodeList betweenValues)