Class OBinaryCondition
java.lang.Object
com.orientechnologies.orient.core.sql.parser.SimpleNode
com.orientechnologies.orient.core.sql.parser.OBooleanExpression
com.orientechnologies.orient.core.sql.parser.OBinaryCondition
- All Implemented Interfaces:
Node
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OExpressionprotected OBinaryCompareOperatorprotected OExpressionFields inherited from class com.orientechnologies.orient.core.sql.parser.OBooleanExpression
FALSE, TRUEFields 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 TypeMethodDescriptionbooleanallowsIndexedFunctionExecutionOnTarget(OFromClause target, OCommandContext context) tests if current expression involves an indexed function AND that function can be used on this targetbooleancanExecuteIndexedFunctionWithoutIndex(OFromClause target, OCommandContext context) tests if current expression involves an indexed function AND that function can also be executed without using the indexcopy()voiddeserialize(OResult fromResult) booleanlongestimateIndexed(OFromClause target, OCommandContext context) booleanevaluate(OResult currentRecord, OCommandContext ctx) executeIndexedFunction(OFromClause target, OCommandContext context) booleanexecuteIndexedFunctionAfterIndexSearch(OFromClause target, OCommandContext context) tests if current expression involves an indexed function AND the function has also to be executed after the index search.voidextractSubQueries(SubQueryCollector collector) findIndex(OIndexFinder info, OCommandContext ctx) getIndexedFunctionConditions(OClass iSchemaClass, ODatabaseDocumentInternal database) getLeft()protected intgetRight()inthashCode()static OSelectStatementindexChainToStatement(OModifier modifier, OClass clazz, OExpression right, OCommandContext ctx, OBinaryCompareOperator operator) booleanisIndexedFunctionCondition(OClass iSchemaClass, ODatabaseDocumentInternal database) booleanneedsAliases(Set<String> aliases) booleanrewriteIndexChainsAsSubqueries(OCommandContext ctx, OClass clazz) voidsetLeft(OExpression left) voidsetOperator(OBinaryCompareOperator operator) voidsetRight(OExpression right) protected booleanvoidtoGenericStatement(StringBuilder builder) voidtoString(Map<Object, Object> params, StringBuilder builder) returns 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.OBooleanExpression
conditionsCount, deserializeFromOResult, encapsulateInAndBlock, extractRidRanges, flatten, isAlwaysTrue, isEmptyMethods 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, toString, toString
-
Field Details
-
left
-
operator
-
right
-
-
Constructor Details
-
OBinaryCondition
public OBinaryCondition(int id) -
OBinaryCondition
-
-
Method Details
-
evaluate
- Specified by:
evaluatein classOBooleanExpression
-
toString
- Specified by:
toStringin classSimpleNode
-
toGenericStatement
- Specified by:
toGenericStatementin classSimpleNode
-
supportsBasicCalculation
protected boolean supportsBasicCalculation()- Specified by:
supportsBasicCalculationin classOBooleanExpression- Returns:
- true if this expression can be calculated in plain Java, false otherwise (eg. LUCENE operator)
-
getNumberOfExternalCalculations
protected int getNumberOfExternalCalculations()- Specified by:
getNumberOfExternalCalculationsin classOBooleanExpression- Returns:
- the number of sub-expressions that have to be calculated using an external engine (eg. LUCENE)
-
getExternalCalculationConditions
- Specified by:
getExternalCalculationConditionsin classOBooleanExpression- Returns:
- the sub-expressions that have to be calculated using an external engine (eg. LUCENE)
-
isIndexedFunctionCondition
public OBinaryCondition isIndexedFunctionCondition(OClass iSchemaClass, ODatabaseDocumentInternal database) -
estimateIndexed
-
executeIndexedFunction
-
canExecuteIndexedFunctionWithoutIndex
tests if current expression involves an indexed function AND that function can also be executed without using the index- Parameters:
target- the query targetcontext- the execution context- Returns:
- true if current expression involves an indexed function AND that function can be used on this target, false otherwise
-
allowsIndexedFunctionExecutionOnTarget
tests if current expression involves an indexed function AND that function can be used on this target- Parameters:
target- the query targetcontext- the execution context- Returns:
- true if current expression involves an indexed function AND that function can be used on this target, false otherwise
-
executeIndexedFunctionAfterIndexSearch
tests if current expression involves an indexed function AND the function has also to be executed after the index search. In some cases, the index search is accurate, so this condition can be excluded from further evaluation. In other cases the result from the index is a superset of the expected result, so the function has to be executed anyway for further filtering- Parameters:
target- the query targetcontext- the execution context- Returns:
- true if current expression involves an indexed function AND the function has also to be executed after the index search.
-
getIndexedFunctionConditions
public List<OBinaryCondition> getIndexedFunctionConditions(OClass iSchemaClass, ODatabaseDocumentInternal database) - Overrides:
getIndexedFunctionConditionsin classOBooleanExpression
-
needsAliases
- Specified by:
needsAliasesin classOBooleanExpression
-
copy
- Specified by:
copyin classOBooleanExpression
-
extractSubQueries
- Specified by:
extractSubQueriesin classOBooleanExpression
-
refersToParent
public boolean refersToParent()- Specified by:
refersToParentin classOBooleanExpression
-
transformToUpdateItem
Description copied from class:OBooleanExpressionreturns 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.
- Overrides:
transformToUpdateItemin classOBooleanExpression- Returns:
- the equivalent of current condition as an UPDATE expression with the same syntax, if possible.
-
getLeft
-
getOperator
-
getRight
-
setLeft
-
setOperator
-
setRight
-
equals
-
hashCode
public int hashCode() -
getMatchPatternInvolvedAliases
- Specified by:
getMatchPatternInvolvedAliasesin classOBooleanExpression
-
translateLuceneOperator
public void translateLuceneOperator()- Overrides:
translateLuceneOperatorin classOBooleanExpression
-
serialize
- Overrides:
serializein classOBooleanExpression
-
deserialize
- Overrides:
deserializein classOBooleanExpression
-
isCacheable
public boolean isCacheable()- Specified by:
isCacheablein classOBooleanExpression
-
rewriteIndexChainsAsSubqueries
- Overrides:
rewriteIndexChainsAsSubqueriesin classOBooleanExpression
-
indexChainToStatement
public static OSelectStatement indexChainToStatement(OModifier modifier, OClass clazz, OExpression right, OCommandContext ctx, OBinaryCompareOperator operator) -
findIndex
- Overrides:
findIndexin classOBooleanExpression
-
getIndexKeyCondition
- Overrides:
getIndexKeyConditionin classOBooleanExpression
-
getIndexRidCondition
- Overrides:
getIndexRidConditionin classOBooleanExpression
-