Class IdentificationVariableDeclaration

  • All Implemented Interfaces:
    Expression

    public final class IdentificationVariableDeclaration
    extends AbstractExpression
    An identification variable is a valid identifier declared in the FROM clause of a query. All identification variables must be declared in the FROM clause. Identification variables cannot be declared in other clauses. An identification variable must not be a reserved identifier or have the same name as any entity in the same persistence unit: Identification variables are case insensitive. An identification variable evaluates to a value of the type of the expression used in declaring the variable.
    BNF: identification_variable_declaration ::= range_variable_declaration { join | fetch_join }*

    Since:
    2.3
    Version:
    2.5
    Author:
    Pascal Filion
    • Constructor Detail

      • IdentificationVariableDeclaration

        public IdentificationVariableDeclaration​(AbstractExpression parent)
        Creates a new IdentificationVariableDeclaration.
        Parameters:
        parent - The parent of this expression
    • Method Detail

      • buildCollectionExpression

        public CollectionExpression buildCollectionExpression()
        Creates a new CollectionExpression that will wrap the single join expression.
        Returns:
        The single join expression represented by a temporary collection
      • getJoins

        public Expression getJoins()
        Returns the unique join (fetch join) or the list of joins (fetch joins) expression.
        Returns:
        The JOIN expression(s) or a null expression if none was declared
      • getRangeVariableDeclaration

        public Expression getRangeVariableDeclaration()
        Returns the variable declaration, which is the abstract schema name and the identification variable.
        Returns:
        The Expression representing the range variable declaration
      • hasJoins

        public boolean hasJoins()
        Determines whether this declaration has any join expressions.
        Returns:
        true if at least one join expression was specified; false otherwise
      • hasRangeVariableDeclaration

        public boolean hasRangeVariableDeclaration()
        Determines whether the range variable declaration was parsed.
        Returns:
        true if the range variable declaration was parsed; false otherwise
      • hasSpace

        public boolean hasSpace()
        Determines whether there is a space after the range variable declaration.
        Returns:
        true if the range variable declaration is followed by a space, false otherwise