Class DBSExpressionEvaluator

java.lang.Object
org.nuxeo.ecm.core.storage.ExpressionEvaluator
org.nuxeo.ecm.core.storage.dbs.DBSExpressionEvaluator

public class DBSExpressionEvaluator extends ExpressionEvaluator
Expression evaluator for a DBSDocument state.
Since:
5.9.4
  • Field Details

  • Constructor Details

    • DBSExpressionEvaluator

      public DBSExpressionEvaluator(DBSSession session, SQLQuery query, String[] principals, boolean fulltextSearchDisabled)
  • Method Details

    • getSelectClause

      public SelectClause getSelectClause()
    • getExpression

      public Expression getExpression()
    • getOrderByClause

      public OrderByClause getOrderByClause()
    • getDocumentTypes

      protected List<String> getDocumentTypes()
    • getMixinDocumentTypes

      protected Set<String> getMixinDocumentTypes(String mixin)
    • isNeverPerInstanceMixin

      protected boolean isNeverPerInstanceMixin(String mixin)
    • parse

      public void parse()
      Initializes parsing datastructures.
    • matches

      public List<Map<String,Serializable>> matches(State state)
      Returns the projection matches for a given state.
    • checkSecurity

      protected boolean checkSecurity(State state)
    • walkAll

      protected Map<String,Serializable> walkAll()
      Does one walk of the expression, using the wildcardIndexes currently defined.
    • walkSelectClauseAndOrderBy

      public Map<String,Serializable> walkSelectClauseAndOrderBy(SelectClause selectClause, OrderByClause orderByClause)
      Walks the select clause and order by clause, and returns the projection.
    • addProjection

      protected void addProjection(Reference ref, Map<String,Serializable> projection)
    • hasWildcardProjection

      public boolean hasWildcardProjection()
    • walkReference

      public Object walkReference(Reference ref)
      Description copied from class: ExpressionEvaluator
      Evaluates a reference over the context state.
      Specified by:
      walkReference in class ExpressionEvaluator
      Parameters:
      ref - the reference
    • walkReferenceGetValueInfo

      protected DBSExpressionEvaluator.ValueInfo walkReferenceGetValueInfo(Reference ref)
    • parseReference

      protected DBSExpressionEvaluator.ValueInfo parseReference(Reference ref)
      Parses and computes value and iterator information for a reference.
    • parseReference

      protected DBSExpressionEvaluator.ValueInfo parseReference(String name, String originalName)
      Gets the canonical reference and parsed reference for this reference name.

      The parsed reference is a list of components to traverse to get the value:

      • String = map key
      • Integer = list element
      • Long = wildcard correlation number (pos/neg)
      Returns:
      the canonical reference (with resolved uncorrelated wildcards)
    • parseACP

      protected DBSExpressionEvaluator.ValueInfo parseACP(String[] parts, String name)
    • initializeValuesAndIterators

      protected void initializeValuesAndIterators(State state)
      Initializes toplevel values and iterators for a given state.
    • init

      protected void init(Object state, List<DBSExpressionEvaluator.ValueInfo> valueInfos, List<DBSExpressionEvaluator.IterInfo> iterInfos)
      Initializes values and iterators for a given state.
    • traverse

      protected Object traverse(Object value, List<Serializable> steps)
      Traverses an object in a series of steps.
    • traverse

      protected Object traverse(Object value, Serializable step)
      Traverses a single step.
    • incrementIterators

      protected boolean incrementIterators()
      Increments iterators lexicographically.

      Returns true when all iterations are finished.

    • walkMixinTypes

      public Boolean walkMixinTypes(List<String> mixins, boolean include)
      Matches the mixin types against a list of values.

      Used for:

      • ecm:mixinTypes = 'foo'
      • ecm:mixinTypes != 'foo'
      • ecm:mixinTypes IN ('foo', 'bar')
      • ecm:mixinTypes NOT IN ('foo', 'bar')

      ecm:mixinTypes IN ('Foo', 'Bar')

      primarytype IN (... types with Foo or Bar ...) OR mixintypes LIKE '%Foo%' OR mixintypes LIKE '%Bar%'

      ecm:mixinTypes NOT IN ('Foo', 'Bar')

      primarytype IN (... types without Foo nor Bar ...) AND (mixintypes NOT LIKE '%Foo%' AND mixintypes NOT LIKE '%Bar%' OR mixintypes IS NULL)

      Specified by:
      walkMixinTypes in class ExpressionEvaluator
      Parameters:
      mixins - the mixin(s) to match
      include - true for = and IN
    • toString

      public String toString()
      Overrides:
      toString in class Object