Class AbstractFromClauseStateObject

    • Constructor Detail

      • AbstractFromClauseStateObject

        protected AbstractFromClauseStateObject​(AbstractSelectStatementStateObject parent)
        Creates a new AbstractFromClauseStateObject.
        parent - The parent of this state object, which cannot be null
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • addCollectionDeclaration

        public CollectionMemberDeclarationStateObject addCollectionDeclaration​(java.lang.String collectionValuedPath,
                                                                               java.lang.String identificationVariable)
        Adds a new collection declaration to the FROM clause.
        collectionValuedPath - The collection-valued path expression
        identificationVariable - The variable defining the collection-valued path expression
        The CollectionMemberDeclarationStateObject representing the collection declaration
      • addProblems

        protected void addProblems​(java.util.List<Problem> currentProblems)
        Adds to the given list the problems that were found with the current state of this StateObject, which means there are validation issues.
        addProblems in class AbstractStateObject
        currentProblems - The list to which the problems are added
      • addRangeDeclaration

        public IdentificationVariableDeclarationStateObject addRangeDeclaration​(IEntity entity,
                                                                                java.lang.String identificationVariable)
        Adds to this select statement a new range variable declaration.
        entity - The external form of the entity to add to the declaration list
        identificationVariable - The unique identifier identifying the abstract schema name
        The state object of the new declaration
      • addRangeDeclaration

        public IdentificationVariableDeclarationStateObject addRangeDeclaration​(java.lang.String entityName,
                                                                                java.lang.String identificationVariable)
        Adds a new range variable declaration.
        entityName - The name of the entity name
        identificationVariable - The new identification variable
        The state object of the new declaration
      • declarationBNF

        protected abstract java.lang.String declarationBNF()
        Returns the BNF of the declaration part of this clause.
        The BNF of the declaration part of this clause
      • getDeclaration

        public DeclarationStateObject getDeclaration()
        Returns the declaration clause which defines the domain of the query by declaring identification variables.
        Specified by:
        getDeclaration in interface StateObject
        getDeclaration in class AbstractStateObject
        The declaration clause of which this StateObject is a child; i.e. either the top-level declaration if this is part of the top query or the sub-level declaration if this is part of a subquery
      • 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"
        Specified by:
        getManagedType in interface DeclarationStateObject
        stateObject - The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE
        The IManagedType representing the domain object declared by the given identification variable
        See Also:
      • parse

        public void parse​(java.lang.String jpqlFragment)
        Parses the given JPQL fragment and create the select item. For the top-level query, the fragment can contain several select items but for a subquery, it can represent only one.
        jpqlFragment - The portion of the query representing one or several select items
      • toTextInternal

        protected void toTextInternal​(java.lang.Appendable writer)
        Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
        Specified by:
        toTextInternal in class AbstractStateObject
        writer - The writer used to print out the string representation
        Throws: - This should never happens, it is only required because Appendable is used instead of any concrete class