java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration
All Implemented Interfaces:
JPQLQueryDeclaration
Direct Known Subclasses:
AbstractRangeDeclaration, CollectionDeclaration, SubqueryDeclaration, TableDeclaration, UnknownDeclaration

public abstract class Declaration extends Object implements JPQLQueryDeclaration
The abstract definition of JPQLQueryDeclaration.
Since:
2.5
Version:
2.5
  • Field Details

    • baseExpression

      protected Expression baseExpression
      Either the range variable declaration if this is a range declaration otherwise the collection-valued path expression when this is a collection member declaration.
    • declarationExpression

      protected Expression declarationExpression
      The declaration expression, which is either an IdentificationVariableDeclaration or a CollectionMemberDeclaration when part of a FROM clause, otherwise it's either the DeleteClause or the UpdateClause.
    • identificationVariable

      protected IdentificationVariable identificationVariable
      The identification variable used to declare the "root" object.
    • rootPath

      protected String rootPath
      The "root" object for objects which may not be reachable by navigation, it is either the abstract schema name (entity name), a derived path expression (which is only defined in a subquery) or null if this Declaration is a collection member declaration.
  • Constructor Details

    • Declaration

      protected Declaration()
      Creates a new Declaration.
  • Method Details

    • getBaseExpression

      public Expression getBaseExpression()
      Description copied from interface: JPQLQueryDeclaration
      Returns the range variable declaration if this is a range declaration otherwise the collection-valued path expression when this is a collection member declaration.
      Specified by:
      getBaseExpression in interface JPQLQueryDeclaration
      Returns:
      Either the range variable declaration or the collection-valued path expression
    • getDeclarationExpression

      public Expression getDeclarationExpression()
      Description copied from interface: JPQLQueryDeclaration
      Returns the declaration expression, which is either an IdentificationVariableDeclaration or a CollectionMemberDeclaration when part of a FROM clause, otherwise it's either the DeleteClause or the UpdateClause.
      Specified by:
      getDeclarationExpression in interface JPQLQueryDeclaration
      Returns:
      The root of the declaration expression
    • getIdentificationVariable

      public IdentificationVariable getIdentificationVariable()
      Returns the IdentificationVariable used to declare the "root" object.
      Returns:
      The alias for the "root" object
    • getJoins

      public List<Join> getJoins()
      Description copied from interface: JPQLQueryDeclaration
      Returns the JOIN expressions defined with this declaration, if supported. The list contains the JOIN expressions in ordered they were declared.
      Specified by:
      getJoins in interface JPQLQueryDeclaration
      Returns:
      The JOIN expressions defined with this declaration or an empty list if this declaration does not support it
    • getRootPath

      public String getRootPath()
      Returns the "root" object for objects which may not be reachable by navigation, it is either the abstract schema name (entity name), a derived path expression (which is only defined in a subquery) or null if this Declaration is a collection member declaration.
      Returns:
      The "root" object for objects which may not be reachable by navigation or null if this Declaration is a collection member declaration
    • getVariableName

      public String getVariableName()
      Description copied from interface: JPQLQueryDeclaration
      Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression
      Specified by:
      getVariableName in interface JPQLQueryDeclaration
      Returns:
      The identification variable or an empty string if none was defined
    • hasJoins

      public boolean hasJoins()
      Description copied from interface: JPQLQueryDeclaration
      Determines whether the declaration contains JOIN expressions. This can be true only when JPQLQueryDeclaration.Type.isRange() returns true. A collection member declaration does not have JOIN expressions.
      Specified by:
      hasJoins in interface JPQLQueryDeclaration
      Returns:
      true if at least one JOIN expression was parsed; otherwise false
    • toString

      public String toString()
      Overrides:
      toString in class Object