org.apache.cayenne.access.translator.ejbql

## Class EJBQLPathTranslator

- java.lang.Object
- - org.apache.cayenne.ejbql.EJBQLBaseVisitor
  - - org.apache.cayenne.access.translator.ejbql.EJBQLPathTranslator

- All Implemented Interfaces:
    EJBQLExpressionVisitor

      public abstract class EJBQLPathTranslator
      extends EJBQLBaseVisitor

  A translator that walks the relationship/attribute path, appending joins to the query.
  Since:
    3.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ObjEntity` | `currentEntity`
    `protected String` | `fullPath`
    `protected String` | `idPath`
    `protected boolean` | `innerJoin`
    `protected String` | `joinMarker`
    `protected String` | `lastAlias`
    `protected String` | `lastPathComponent`

    - ### Fields inherited from class org.apache.cayenne.ejbql.EJBQLBaseVisitor

      `continueFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EJBQLPathTranslator(EJBQLTranslationContext context)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `appendMultiColumnPath(EJBQLMultiColumnOperand operand)`
    `protected DbRelationship` | `chooseDbRelationship(ObjRelationship relationship)` Checks if the object relationship is flattened and then chooses the corresponding db relationship.
    `boolean` | `isUsingAliases()`
    `protected void` | `processIntermediatePathComponent()`
    `protected void` | `processLastPathComponent()`
    `protected void` | `processTerminatingAttribute(ObjAttribute attribute)`
    `protected void` | `processTerminatingRelationship(ObjRelationship relationship)`
    `protected void` | `resolveJoin()`
    `protected void` | `resolveLastPathComponent(String pathComponent)`
    `void` | `setUsingAliases(boolean usingAliases)`
    `boolean` | `visitIdentificationVariable(EJBQLExpression expression)`
    `boolean` | `visitIdentifier(EJBQLExpression expression)`
    `boolean` | `visitPath(EJBQLExpression expression, int finishedChildIndex)` Called on visiting "path" expression and also after visiting every expression child.

    - ### Methods inherited from class org.apache.cayenne.ejbql.EJBQLBaseVisitor

      `visitAbs, visitAbstractSchemaName, visitAdd, visitAggregate, visitAll, visitAnd, visitAny, visitAscending, visitAverage, visitBetween, visitBooleanLiteral, visitClassName, visitConcat, visitConstructor, visitConstructorParameter, visitConstructorParameters, visitCount, visitCurrentDate, visitCurrentTime, visitCurrentTimestamp, visitDbPath, visitDecimalLiteral, visitDelete, visitDescending, visitDistinct, visitDivide, visitEquals, visitEscapeCharacter, visitExists, visitFrom, visitFromItem, visitGreaterOrEqual, visitGreaterThan, visitGroupBy, visitHaving, visitIn, visitInnerFetchJoin, visitInnerJoin, visitIntegerLiteral, visitIsEmpty, visitIsNull, visitLength, visitLessOrEqual, visitLessThan, visitLike, visitLocate, visitLower, visitMax, visitMemberOf, visitMin, visitMod, visitMultiply, visitNamedInputParameter, visitNamedInputParameterForIn, visitNegative, visitNot, visitNotEquals, visitOr, visitOrderBy, visitOrderByItem, visitOuterFetchJoin, visitOuterJoin, visitPatternValue, visitPositionalInputParameter, visitPositionalInputParameterForIn, visitSelect, visitSelectClause, visitSelectExpression, visitSelectExpressions, visitSize, visitSqrt, visitStringLiteral, visitSubselect, visitSubstring, visitSubtract, visitSum, visitTok, visitTrim, visitTrimBoth, visitTrimCharacter, visitTrimLeading, visitTrimTrailing, visitUpdate, visitUpdateField, visitUpdateItem, visitUpdateValue, visitUpper, visitWhere`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### currentEntity

          protected ObjEntity currentEntity

    - #### lastPathComponent

          protected String lastPathComponent

    - #### innerJoin

          protected boolean innerJoin

    - #### lastAlias

          protected String lastAlias

    - #### idPath

          protected String idPath

    - #### joinMarker

          protected String joinMarker

    - #### fullPath

          protected String fullPath

  - ### Constructor Detail

    - #### EJBQLPathTranslator

          public EJBQLPathTranslator(EJBQLTranslationContext context)

  - ### Method Detail

    - #### appendMultiColumnPath

          protected abstract void appendMultiColumnPath(EJBQLMultiColumnOperand operand)

    - #### visitPath

          public boolean visitPath(EJBQLExpression expression,
                                   int finishedChildIndex)

      Description copied from interface: `EJBQLExpressionVisitor`
      Called on visiting "path" expression and also after visiting every expression child.
      Specified by:
        `visitPath` in interface `EJBQLExpressionVisitor`
      Overrides:
        `visitPath` in class `EJBQLBaseVisitor`
      Parameters:
        `expression` - a "path" node being visited.
        `finishedChildIndex` - "-1" when the expression node is visited for the first time, before its children; otherwise this is an index of a child just visited.

    - #### visitIdentifier

          public boolean visitIdentifier(EJBQLExpression expression)

      Specified by:
        `visitIdentifier` in interface `EJBQLExpressionVisitor`
      Overrides:
        `visitIdentifier` in class `EJBQLBaseVisitor`

    - #### visitIdentificationVariable

          public boolean visitIdentificationVariable(EJBQLExpression expression)

      Specified by:
        `visitIdentificationVariable` in interface `EJBQLExpressionVisitor`
      Overrides:
        `visitIdentificationVariable` in class `EJBQLBaseVisitor`

    - #### resolveLastPathComponent

          protected void resolveLastPathComponent(String pathComponent)

      Since:
        4.0

    - #### resolveJoin

          protected void resolveJoin()

    - #### processIntermediatePathComponent

          protected void processIntermediatePathComponent()

    - #### processLastPathComponent

          protected void processLastPathComponent()

    - #### processTerminatingAttribute

          protected void processTerminatingAttribute(ObjAttribute attribute)

    - #### processTerminatingRelationship

          protected void processTerminatingRelationship(ObjRelationship relationship)

    - #### chooseDbRelationship

          protected DbRelationship chooseDbRelationship(ObjRelationship relationship)

      Checks if the object relationship is flattened and then chooses the corresponding db relationship. The last in idPath if isFlattened and the first in list otherwise.
      Parameters:
        `relationship` - the object relationship
      Returns:
        `DbRelationship`

    - #### isUsingAliases

          public boolean isUsingAliases()

    - #### setUsingAliases

          public void setUsingAliases(boolean usingAliases)

Copyright © 2001–2018 Apache Cayenne. All rights reserved.