Class RangeVariableDeclarationStateObject

  • All Implemented Interfaces:
    StateObject, VariableDeclarationStateObject

    public class RangeVariableDeclarationStateObject
    extends AbstractRangeVariableDeclarationStateObject
    Range variable declarations allow the developer to designate a "root" for objects which may not be reachable by navigation. In order to select values by comparing more than one instance of an entity abstract schema type, more than one identification variable ranging over the abstract schema type is needed in the FROM clause.
    BNF: range_variable_declaration ::= abstract_schema_name [AS] identification_variable

    Version:
    2.4
    See Also:
    RangeVariableDeclaration
    Author:
    Pascal Filion
    Since:
    2.4
    • Constructor Detail

      • RangeVariableDeclarationStateObject

        public RangeVariableDeclarationStateObject​(AbstractModifyClauseStateObject parent)
        Creates a new RangeVariableDeclarationStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • RangeVariableDeclarationStateObject

        public RangeVariableDeclarationStateObject​(IdentificationVariableDeclarationStateObject parent)
        Creates a new RangeVariableDeclarationStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • RangeVariableDeclarationStateObject

        public RangeVariableDeclarationStateObject​(IdentificationVariableDeclarationStateObject parent,
                                                   java.lang.String entityName)
        Creates a new RangeVariableDeclarationStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        entityName - The name of the abstract schema, which is the name of the entity
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • getEntity

        public IEntity getEntity()
        Returns the actual IEntity that has the abstract schema name.
        Returns:
        The actual IEntity or null if no entity exists
      • getEntityName

        public java.lang.String getEntityName()
        Returns the abstract schema name.
        Returns:
        The name of the abstract schema type for which the identification variable is ranging over
      • getManagedType

        public IManagedType getManagedType​(StateObject stateObject)
        Returns the IManagedType for the given identification variable. The search does not traverse up the query hierarchy if this declaration is for a subquery.
        SELECT e FROM Department d JOIN KEY(d.employees).addresses a
        In the above query, the managed type associated with the identification variable:
        • d is "Department"
        • a is "Address"
        Parameters:
        stateObject - The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE
        Returns:
        The IManagedType representing the domain object declared by the given identification variable
      • setDeclaration

        public void setDeclaration​(IEntity entity)
        Sets the abstract schema name to the given value.
        Parameters:
        entity - The IEntity that this clause will range over
      • setDeclaration

        public void setDeclaration​(IEntity entity,
                                   java.lang.String identificationVariable)
        Sets the abstract schema name to the given value and the identification variable that will range over it.
        Parameters:
        entity - The IEntity that this clause will range over
        identificationVariable - The new identification variable
      • setDeclaration

        public void setDeclaration​(java.lang.String entityName,
                                   java.lang.String identificationVariable)
        Sets the abstract schema name to the given value and the identification variable that will range over it.
        Parameters:
        entityName - The name of the entity name
        identificationVariable - The new identification variable
      • setEntity

        public void setEntity​(IEntity entity)
        Sets the actual IEntity and updates the abstract schema name.
        Parameters:
        entity - The IEntity that the clause will range over
      • setEntityName

        public void setEntityName​(java.lang.String abstractSchemaName)
        Sets the name of the abstract schema, which is the name of the entity.
        Parameters:
        abstractSchemaName - The name of the abstract schema, which is the name of the entity