java.lang.Object
com.orientechnologies.orient.core.sql.parser.SimpleNode
com.orientechnologies.orient.core.sql.parser.OExpression
All Implemented Interfaces:
Node
Direct Known Subclasses:
OArrayConcatExpressionElement, OValueExpression

public class OExpression extends SimpleNode
  • Field Details

    • singleQuotes

      protected Boolean singleQuotes
    • doubleQuotes

      protected Boolean doubleQuotes
    • isNull

      protected boolean isNull
    • rid

      protected ORid rid
    • mathExpression

      protected OMathExpression mathExpression
    • arrayConcatExpression

      protected OArrayConcatExpression arrayConcatExpression
    • json

      protected OJson json
    • booleanValue

      protected Boolean booleanValue
  • Constructor Details

  • Method Details

    • execute

      public Object execute(OResult iCurrentRecord, OCommandContext ctx)
    • getIndexKey

      public Collection<Object> getIndexKey(OCommandContext ctx)
    • isBaseIdentifier

      public boolean isBaseIdentifier()
    • getPath

      public Optional<OPath> getPath()
    • isEarlyCalculated

      public boolean isEarlyCalculated(OCommandContext ctx)
    • getDefaultAlias

      public OIdentifier getDefaultAlias()
    • toString

      public void toString(Map<Object,Object> params, StringBuilder builder)
      Specified by:
      toString in class SimpleNode
    • toGenericStatement

      public void toGenericStatement(StringBuilder builder)
      Specified by:
      toGenericStatement in class SimpleNode
    • encode

      public static String encode(String s)
    • supportsBasicCalculation

      public boolean supportsBasicCalculation()
    • isIndexedFunctionCal

      public boolean isIndexedFunctionCal()
    • encodeSingle

      public static String encodeSingle(String s)
    • estimateIndexedFunction

      public long estimateIndexedFunction(OFromClause target, OCommandContext context, OBinaryCompareOperator operator, Object right)
    • executeIndexedFunction

      public Iterable<OIdentifiable> executeIndexedFunction(OFromClause target, OCommandContext context, OBinaryCompareOperator operator, Object right)
    • canExecuteIndexedFunctionWithoutIndex

      public boolean canExecuteIndexedFunctionWithoutIndex(OFromClause target, OCommandContext context, OBinaryCompareOperator operator, Object right)
      tests if current expression is an indexed function AND that function can also be executed without using the index
      Parameters:
      target - the query target
      context - the execution context
      operator -
      right -
      Returns:
      true if current expression is an indexed function AND that function can also be executed without using the index, false otherwise
    • allowsIndexedFunctionExecutionOnTarget

      public boolean allowsIndexedFunctionExecutionOnTarget(OFromClause target, OCommandContext context, OBinaryCompareOperator operator, Object right)
      tests if current expression is an indexed function AND that function can be used on this target
      Parameters:
      target - the query target
      context - the execution context
      operator -
      right -
      Returns:
      true if current expression involves an indexed function AND that function can be used on this target, false otherwise
    • executeIndexedFunctionAfterIndexSearch

      public boolean executeIndexedFunctionAfterIndexSearch(OFromClause target, OCommandContext context, OBinaryCompareOperator operator, Object right)
      tests if current expression is 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 target
      context - the execution context
      Returns:
      true if current expression involves an indexed function AND the function has also to be executed after the index search.
    • isExpand

      public boolean isExpand()
    • getExpandContent

      public OExpression getExpandContent()
    • needsAliases

      public boolean needsAliases(Set<String> aliases)
    • isAggregate

      public boolean isAggregate()
    • splitForAggregation

      public OExpression splitForAggregation(AggregateProjectionSplit aggregateSplit, OCommandContext ctx)
    • getAggregationContext

      public AggregationContext getAggregationContext(OCommandContext ctx)
    • copy

      public OExpression copy()
      Overrides:
      copy in class SimpleNode
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setMathExpression

      public void setMathExpression(OMathExpression mathExpression)
    • extractSubQueries

      public void extractSubQueries(SubQueryCollector collector)
    • extractSubQueries

      public void extractSubQueries(OIdentifier letAlias, SubQueryCollector collector)
    • refersToParent

      public boolean refersToParent()
    • getRid

      public ORid getRid()
    • setRid

      public void setRid(ORid rid)
    • getMathExpression

      public OMathExpression getMathExpression()
    • applyRemove

      public void applyRemove(OResultInternal result, OCommandContext ctx)
    • isCount

      public boolean isCount()
    • getArrayConcatExpression

      public OArrayConcatExpression getArrayConcatExpression()
    • setArrayConcatExpression

      public void setArrayConcatExpression(OArrayConcatExpression arrayConcatExpression)
    • serialize

      public OResult serialize()
    • deserialize

      public void deserialize(OResult fromResult)
    • isDefinedFor

      public boolean isDefinedFor(OResult currentRecord)
    • isDefinedFor

      public boolean isDefinedFor(OElement currentRecord)
    • getCollate

      public OCollate getCollate(OResult currentRecord, OCommandContext ctx)
    • isCacheable

      public boolean isCacheable()
    • isIndexChain

      public boolean isIndexChain(OCommandContext ctx, OClass clazz)
    • isFunctionAny

      public boolean isFunctionAny()
    • isFunctionAll

      public boolean isFunctionAll()
    • setNull

      public void setNull(boolean isNull)
    • isSelf

      public boolean isSelf()