Class OQueryOperator
java.lang.Object
com.orientechnologies.orient.core.sql.operator.OQueryOperator
- Direct Known Subclasses:
OQueryOperatorAnd,OQueryOperatorDivide,OQueryOperatorEquality,OQueryOperatorMinus,OQueryOperatorMod,OQueryOperatorMultiply,OQueryOperatorNot,OQueryOperatorOr,OQueryOperatorPlus,OQueryTargetOperator
Query Operators. Remember to handle the operator in OQueryItemCondition.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOQueryOperator(String iKeyword, int iPrecedence, boolean iUnary) protectedOQueryOperator(String iKeyword, int iPrecedence, boolean iUnary, int iExpectedRightWords) protectedOQueryOperator(String iKeyword, int iPrecedence, boolean iUnary, int iExpectedRightWords, boolean iExpectsParameters) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancompare(OQueryOperator other) Check priority of this operator compare to given operator.Default State-less implementation: does not save parameters and just return itselfbooleanabstract ObjectevaluateRecord(OIdentifiable iRecord, ODocument iCurrentResult, OSQLFilterCondition iCondition, Object iLeft, Object iRight, OCommandContext iContext, ODocumentSerializer serializer) executeIndexQuery(OCommandContext iContext, OIndex index, List<Object> keyParams, boolean ascSortOrder) Performs index query and returns index stream which presents subset of index data which corresponds to result of execution of given operator.abstract ORIDgetBeginRidRange(Object iLeft, Object iRight) abstract ORIDgetEndRidRange(Object iLeft, Object iRight) abstract OIndexReuseTypegetIndexReuseType(Object iLeft, Object iRight) Returns hint how index can be used to calculate result of operator execution.getOIndexSearchResult(OClass iSchemaClass, OSQLFilterCondition iCondition, List<OIndexSearchResult> iIndexSearchResults, OCommandContext context) booleanbooleanisUnary()toString()protected voidupdateProfiler(OCommandContext iContext, OIndex index, List<Object> keyParams, OIndexDefinition indexDefinition)
-
Field Details
-
DEFAULT_OPERATORS_ORDER
Default operator order. can be used by additional operator to locate themself relatively to default ones.WARNING: ORDER IS IMPORTANT TO AVOID SUB-STRING LIKE "IS" and AND "INSTANCEOF": INSTANCEOF MUST BE PLACED BEFORE! AND ALSO FOR PERFORMANCE (MOST USED BEFORE)
-
keyword
-
precedence
public final int precedence -
expectedRightWords
public final int expectedRightWords -
unary
public final boolean unary -
expectsParameters
public final boolean expectsParameters
-
-
Constructor Details
-
OQueryOperator
-
OQueryOperator
-
OQueryOperator
protected OQueryOperator(String iKeyword, int iPrecedence, boolean iUnary, int iExpectedRightWords, boolean iExpectsParameters)
-
-
Method Details
-
evaluateRecord
public abstract Object evaluateRecord(OIdentifiable iRecord, ODocument iCurrentResult, OSQLFilterCondition iCondition, Object iLeft, Object iRight, OCommandContext iContext, ODocumentSerializer serializer) -
getIndexReuseType
Returns hint how index can be used to calculate result of operator execution.- Parameters:
iLeft- Value of left query parameter.iRight- Value of right query parameter.- Returns:
- Hint how index can be used to calculate result of operator execution.
-
getOIndexSearchResult
public OIndexSearchResult getOIndexSearchResult(OClass iSchemaClass, OSQLFilterCondition iCondition, List<OIndexSearchResult> iIndexSearchResults, OCommandContext context) -
executeIndexQuery
public Stream<ORawPair<Object,ORID>> executeIndexQuery(OCommandContext iContext, OIndex index, List<Object> keyParams, boolean ascSortOrder) Performs index query and returns index stream which presents subset of index data which corresponds to result of execution of given operator.Query that should be executed can be presented like: [[property0 = keyParam0] and [property1 = keyParam1] and] propertyN operator keyParamN.
It is supped that index which passed in as parameter is used to index properties listed above and responsibility of given method execute query using given parameters.
Multiple parameters are passed in to implement composite indexes support.
- Parameters:
iContext-index- Instance of index that will be used to calculate result of operator execution.keyParams- Parameters of query is used to calculate query result.ascSortOrder- Data returned by cursors should be sorted in ascending or descending order.- Returns:
- Cursor instance if index can be used to evaluate result of execution of given operator
and
nullotherwise.
-
toString
-
configure
Default State-less implementation: does not save parameters and just return itself- Parameters:
iParams-- Returns:
-
getSyntax
-
getBeginRidRange
-
getEndRidRange
-
isUnary
public boolean isUnary() -
compare
Check priority of this operator compare to given operator.- Parameters:
other-- Returns:
- ORDER place of this operator compared to given operator
-
updateProfiler
protected void updateProfiler(OCommandContext iContext, OIndex index, List<Object> keyParams, OIndexDefinition indexDefinition) -
canShortCircuit
-
canBeMerged
public boolean canBeMerged() -
isSupportingBinaryEvaluate
public boolean isSupportingBinaryEvaluate() -
getKeyword
-
evaluate
-