EJBQLPathTranslator (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.access.translator.ejbql, class: EJBQLPathTranslator

# 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
  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 EJBQLBaseVisitor

  `continueFlag`
  Modifier and Type
  Field
  Description
  `protected boolean`
  `continueFlag`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EJBQLPathTranslator(EJBQLTranslationContext context)`

- ## Method Summary

  Modifier and Type
  Method
  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 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`
  Modifier and Type
  Method
  Description
  `boolean`
  `visitAbs(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitAbstractSchemaName(EJBQLExpression expression)`
  `boolean`
  `visitAdd(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "add" expression and also after visiting every expression child.
  `boolean`
  `visitAggregate(EJBQLExpression expression)`
  `boolean`
  `visitAll(EJBQLExpression expression)`
  `boolean`
  `visitAnd(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "and" expression and also after visiting every expression child.
  `boolean`
  `visitAny(EJBQLExpression expression)`
  `boolean`
  `visitAscending(EJBQLExpression expression)`
  `boolean`
  `visitAverage(EJBQLAggregateColumn expression)`
  `boolean`
  `visitBetween(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "between" expression and also after visiting every expression child.
  `boolean`
  `visitBooleanLiteral(EJBQLExpression expression)`
  `boolean`
  `visitClassName(EJBQLExpression expression)`
  `boolean`
  `visitConcat(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitConstructor(EJBQLExpression expression)`
  `boolean`
  `visitConstructorParameter(EJBQLExpression expression)`
  `boolean`
  `visitConstructorParameters(EJBQLExpression expression)`
  `boolean`
  `visitCount(EJBQLAggregateColumn expression)`
  `boolean`
  `visitCurrentDate(EJBQLExpression expression)`
  `boolean`
  `visitCurrentTime(EJBQLExpression expression)`
  `boolean`
  `visitCurrentTimestamp(EJBQLExpression expression)`
  `boolean`
  `visitDbPath(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitDecimalLiteral(EJBQLDecimalLiteral expression)`
  `boolean`
  `visitDelete(EJBQLExpression expression)`
  `boolean`
  `visitDescending(EJBQLExpression expression)`
  `boolean`
  `visitDistinct(EJBQLExpression expression)`
  `boolean`
  `visitDivide(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "divide" expression and also after visiting every expression child.
  `boolean`
  `visitEquals(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "equals" expression and also after visiting every expression child.
  `boolean`
  `visitEscapeCharacter(EJBQLExpression expression)`
  `boolean`
  `visitExists(EJBQLExpression expression)`
  `boolean`
  `visitFrom(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitFromItem(EJBQLFromItem expression, int finishedChildIndex)`
  `boolean`
  `visitGreaterOrEqual(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting ">=" expression and also after visiting every expression child.
  `boolean`
  `visitGreaterThan(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting ">=" expression and also after visiting every expression child.
  `boolean`
  `visitGroupBy(EJBQLExpression expression)`
  `boolean`
  `visitHaving(EJBQLExpression expression)`
  `boolean`
  `visitIn(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitInnerFetchJoin(EJBQLJoin join)`
  `boolean`
  `visitInnerJoin(EJBQLJoin join)`
  `boolean`
  `visitIntegerLiteral(EJBQLIntegerLiteral expression)`
  `boolean`
  `visitIsEmpty(EJBQLExpression expression)`
  `boolean`
  `visitIsNull(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitLength(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitLessOrEqual(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "<=" expression and also after visiting every expression child.
  `boolean`
  `visitLessThan(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "<" expression and also after visiting every expression child.
  `boolean`
  `visitLike(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "LIKE" expression and also after visiting every expression child.
  `boolean`
  `visitLocate(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitLower(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitMax(EJBQLAggregateColumn expression)`
  `boolean`
  `visitMemberOf(EJBQLExpression expression)`
  `boolean`
  `visitMin(EJBQLAggregateColumn expression)`
  `boolean`
  `visitMod(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitMultiply(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "*" expression and also after visiting every expression child.
  `boolean`
  `visitNamedInputParameter(EJBQLExpression expression)`
  `boolean`
  `visitNamedInputParameterForIn(EJBQLExpression expression)`
  This method is invoked from the processing of the `EJBQLIn` in order to handle a query such as;
  `boolean`
  `visitNegative(EJBQLExpression expression)`
  `boolean`
  `visitNot(EJBQLExpression expression)`
  `boolean`
  `visitNotEquals(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "!
  `boolean`
  `visitOr(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "or" expression and also after visiting every expression child.
  `boolean`
  `visitOrderBy(EJBQLExpression expression)`
  `boolean`
  `visitOrderByItem(EJBQLExpression expression)`
  `boolean`
  `visitOuterFetchJoin(EJBQLJoin join)`
  `boolean`
  `visitOuterJoin(EJBQLJoin join)`
  `boolean`
  `visitPatternValue(EJBQLExpression expression)`
  `boolean`
  `visitPositionalInputParameter(EJBQLPositionalInputParameter expression)`
  `boolean`
  `visitPositionalInputParameterForIn(EJBQLPositionalInputParameter expression)`
  This method is invoked from the processing of the `EJBQLIn` in order to handle a query such as;
  `boolean`
  `visitSelect(EJBQLExpression expression)`
  `boolean`
  `visitSelectClause(EJBQLExpression expression)`
  `boolean`
  `visitSelectExpression(EJBQLExpression expression)`
  `boolean`
  `visitSelectExpressions(EJBQLExpression expression)`
  `boolean`
  `visitSize(EJBQLExpression expression)`
  `boolean`
  `visitSqrt(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitStringLiteral(EJBQLExpression expression)`
  `boolean`
  `visitSubselect(EJBQLExpression expression)`
  `boolean`
  `visitSubstring(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitSubtract(EJBQLExpression expression, int finishedChildIndex)`
  Called on visiting "subtract" expression and also after visiting every expression child.
  `boolean`
  `visitSum(EJBQLAggregateColumn expression)`
  `boolean`
  `visitTok(EJBQLExpression expression)`
  `boolean`
  `visitTrim(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitTrimBoth(EJBQLExpression expression)`
  `boolean`
  `visitTrimCharacter(EJBQLExpression expression)`
  `boolean`
  `visitTrimLeading(EJBQLExpression expression)`
  `boolean`
  `visitTrimTrailing(EJBQLExpression expression)`
  `boolean`
  `visitUpdate(EJBQLExpression expression)`
  `boolean`
  `visitUpdateField(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitUpdateItem(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitUpdateValue(EJBQLExpression expression)`
  `boolean`
  `visitUpper(EJBQLExpression expression, int finishedChildIndex)`
  `boolean`
  `visitWhere(EJBQLExpression expression)`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### 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 Details

  - ### EJBQLPathTranslator

    public EJBQLPathTranslator(EJBQLTranslationContext context)

- ## Method Details

  - ### 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)