Class OBooleanExpression
java.lang.Object
com.orientechnologies.orient.core.sql.parser.SimpleNode
com.orientechnologies.orient.core.sql.parser.OBooleanExpression
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
OAndBlock,OBetweenCondition,OBinaryCondition,OContainsAllCondition,OContainsAnyCondition,OContainsCondition,OContainsTextCondition,OContainsValueCondition,OFalseExpression,OInCondition,OInstanceofCondition,OIsDefinedCondition,OIsNotDefinedCondition,OIsNotNullCondition,OIsNullCondition,OMatchesCondition,ONotBlock,ONotInCondition,OOrBlock,OParenthesisBlock,OTrueExpression
Created by luigidellaquila on 07/11/14.
-
Field Summary
FieldsFields inherited from class com.orientechnologies.orient.core.sql.parser.SimpleNode
children, firstToken, id, lastToken, PARAMETER_PLACEHOLDER, parent, parser, value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintabstract OBooleanExpressioncopy()voiddeserialize(OResult fromResult) static OBooleanExpressionprotected OAndBlockabstract booleanevaluate(OResult currentRecord, OCommandContext ctx) abstract voidextractSubQueries(SubQueryCollector collector) findIndex(OIndexFinder info, OCommandContext ctx) flatten()getIndexedFunctionConditions(OClass iSchemaClass, ODatabaseDocumentInternal database) protected abstract intbooleanreturns true only if the expression does not need any further evaluation (eg.abstract booleanbooleanisEmpty()abstract booleanneedsAliases(Set<String> aliases) abstract booleanrewriteIndexChainsAsSubqueries(OCommandContext ctx, OClass clazz) protected abstract booleanreturns the equivalent of current condition as an UPDATE expression with the same syntax, if possible.voidMethods inherited from class com.orientechnologies.orient.core.sql.parser.SimpleNode
dump, getValue, jjtAddChild, jjtClose, jjtGetChild, jjtGetFirstToken, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, jjtSetValue, toGenericStatement, toGenericStatement, toString, toString, toString
-
Field Details
-
TRUE
-
FALSE
-
-
Constructor Details
-
OBooleanExpression
public OBooleanExpression(int id) -
OBooleanExpression
-
-
Method Details
-
evaluate
-
supportsBasicCalculation
protected abstract boolean supportsBasicCalculation()- Returns:
- true if this expression can be calculated in plain Java, false otherwise (eg. LUCENE operator)
-
getNumberOfExternalCalculations
protected abstract int getNumberOfExternalCalculations()- Returns:
- the number of sub-expressions that have to be calculated using an external engine (eg. LUCENE)
-
getExternalCalculationConditions
- Returns:
- the sub-expressions that have to be calculated using an external engine (eg. LUCENE)
-
getIndexedFunctionConditions
public List<OBinaryCondition> getIndexedFunctionConditions(OClass iSchemaClass, ODatabaseDocumentInternal database) -
flatten
-
encapsulateInAndBlock
-
needsAliases
-
copy
- Overrides:
copyin classSimpleNode
-
isEmpty
public boolean isEmpty() -
extractSubQueries
-
refersToParent
public abstract boolean refersToParent() -
transformToUpdateItem
returns the equivalent of current condition as an UPDATE expression with the same syntax, if possible.Eg. name = 3 can be considered a condition or an assignment. This method transforms the condition in an assignment. This is used mainly for UPSERT operations.
- Returns:
- the equivalent of current condition as an UPDATE expression with the same syntax, if possible.
-
getMatchPatternInvolvedAliases
-
translateLuceneOperator
public void translateLuceneOperator() -
deserializeFromOResult
-
serialize
-
deserialize
-
isCacheable
public abstract boolean isCacheable() -
rewriteIndexChainsAsSubqueries
-
isAlwaysTrue
public boolean isAlwaysTrue()returns true only if the expression does not need any further evaluation (eg. "true") and always evaluates to true. It is supposed to be used as and optimization, and is allowed to return false negatives- Returns:
-
findIndex
-
extractRidRanges
-
conditionsCount
public int conditionsCount() -
getIndexKeyCondition
-
getIndexRidCondition
-