Class BooleanConstantNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.ConstantNode
org.apache.derby.impl.sql.compile.BooleanConstantNode
- All Implemented Interfaces:
Visitable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) booleanFields inherited from class ConstantNode
valueFields inherited from class ValueNode
transformedFields inherited from class QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) ValueNodeeliminateNots(boolean underNotNode) Eliminate NotNodes in the current query block.(package private) voidThis generates the proper constant.(package private) ObjectReturn an Object representing the bind time value of this expression tree.(package private) StringReturn the value as a string.(package private) booleanDoes this represent a false constant.(package private) booleanDoes this represent a true constant.doubleselectivity(Optimizable optTable) The default selectivity for value nodes is 50%.(package private) voidsetValue(DataValueDescriptor value) Set the value in this ConstantNode.Methods inherited from class ConstantNode
bindExpression, constantExpression, generateExpression, getClone, getOrderableVariantType, getValue, isCloneable, isConstantExpression, isEquivalent, isNull, toStringMethods inherited from class ValueNode
bindExpression, categorize, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getColumnName, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeKind, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, requiresTypeFromContext, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTopMethods inherited from class QueryTreeNode
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
-
Field Details
-
booleanValue
boolean booleanValue -
unknownValue
boolean unknownValue
-
-
Constructor Details
-
BooleanConstantNode
BooleanConstantNode(ContextManager cm) throws StandardException - Parameters:
cm- context manager- Throws:
StandardException
-
BooleanConstantNode
BooleanConstantNode(boolean value, ContextManager cm) throws StandardException - Throws:
StandardException
-
BooleanConstantNode
BooleanConstantNode(TypeId t, ContextManager cm) throws StandardException - Throws:
StandardException
-
-
Method Details
-
getConstantValueAsObject
Object getConstantValueAsObject()Return an Object representing the bind time value of this expression tree. If the expression tree does not evaluate to a constant at bind time then we return null. This is useful for bind time resolution of VTIs. RESOLVE: What do we do for primitives?- Overrides:
getConstantValueAsObjectin classValueNode- Returns:
- An Object representing the bind time value of this expression tree. (null if not a bind time constant.)
-
getValueAsString
-
isBooleanTrue
boolean isBooleanTrue()Does this represent a true constant.- Overrides:
isBooleanTruein classValueNode- Returns:
- Whether or not this node represents a true constant.
-
isBooleanFalse
boolean isBooleanFalse()Does this represent a false constant.- Overrides:
isBooleanFalsein classValueNode- Returns:
- Whether or not this node represents a false constant.
-
selectivity
The default selectivity for value nodes is 50%. This is overridden in specific cases, such as the RelationalOperators.- Overrides:
selectivityin classValueNode
-
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.- Overrides:
eliminateNotsin classValueNode- Parameters:
underNotNode- Whether or not we are under a NotNode.- Returns:
- The modified expression
-
generateConstant
This generates the proper constant. It is implemented by every specific constant node (e.g. IntConstantNode).- Specified by:
generateConstantin classConstantNode- Parameters:
acb- The ExpressionClassBuilder for the class being builtmb- The method the code to place the code
-
setValue
Set the value in this ConstantNode.- Overrides:
setValuein classConstantNode
-