Class AbstractSelectStatementStateObject

    • Field Detail

      • GROUP_BY_CLAUSE_PROPERTY

        public static java.lang.String GROUP_BY_CLAUSE_PROPERTY
        Notify the state object representing the GROUP BY clause has changed.
      • HAVING_CLAUSE_PROPERTY

        public static java.lang.String HAVING_CLAUSE_PROPERTY
        Notify the state object representing the HAVING clause has changed.
      • WHERE_CLAUSE_PROPERTY

        public static java.lang.String WHERE_CLAUSE_PROPERTY
        Notify the state object representing the WHERE clause has changed.
    • Method Detail

      • addCollectionDeclaration

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

        public GroupByClauseStateObject addGroupByClause​(java.lang.String jpqlFragment)
        Adds the GROUP BY clause and parses the given JPQL fragment. The clause is not added if it's already present.
        Parameters:
        jpqlFragment - The fragment of the JPQL to parse that represents the group by items, the fragment cannot start with GROUP BY
        Returns:
        The GroupByClauseStateObject
      • addHavingClause

        public HavingClauseStateObject addHavingClause​(java.lang.String jpqlFragment)
        Adds the HAVING clause and parses the given JPQL fragment. The clause is not added if it's already present.
        Parameters:
        jpqlFragment - The fragment of the JPQL to parse that represents the conditional expression, the fragment cannot start with HAVING
        Returns:
        The HavingClauseStateObject
      • addRangeDeclaration

        public IdentificationVariableDeclarationStateObject addRangeDeclaration​(IEntity entity,
                                                                                java.lang.String identificationVariable)
        Adds to this select statement a new range variable declaration.
        Parameters:
        entity - The external form of the entity to add to the declaration list
        identificationVariable - The unique identifier identifying the given IEntity
        Returns:
        The StateObject representing the new range variable declaration
      • addRangeDeclaration

        public IdentificationVariableDeclarationStateObject addRangeDeclaration​(java.lang.String entityName,
                                                                                java.lang.String identificationVariable)
        Adds to this select statement a new range variable declaration.
        Parameters:
        entityName - The name of the entity
        identificationVariable - The unique identifier identifying the entity
        Returns:
        The StateObject representing the range variable declaration
      • addWhereClause

        public WhereClauseStateObject addWhereClause​(java.lang.String jpqlFragment)
        Adds the WHERE clause and parses the given JPQL fragment. The clause is not added if it's already present.
        Parameters:
        jpqlFragment - The fragment of the JPQL to parse that represents the conditional expression, the fragment cannot start with WHERE
        Returns:
        The WhereClauseStateObject
      • 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
        Overrides:
        getDeclaration in class AbstractStateObject
        Returns:
        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
      • getFromClause

        public AbstractFromClauseStateObject getFromClause()
        Returns the state object representing the FROM clause.
        Returns:
        The state object representing the FROM clause, which is never null
      • getGroupByClause

        public GroupByClauseStateObject getGroupByClause()
        Returns the state object representing the GROUP BY clause.
        Returns:
        Either the actual state object representing the GROUP BY clause or null if it's not present
      • getHavingClause

        public HavingClauseStateObject getHavingClause()
        Returns the state object representing the HAVING clause.
        Returns:
        Either the actual state object representing the HAVING clause or null if it's not present
      • getSelectClause

        public AbstractSelectClauseStateObject getSelectClause()
        Returns the state object representing the SELECT clause.
        Returns:
        Either the actual state object representing the SELECT clause, which is never null
      • getWhereClause

        public WhereClauseStateObject getWhereClause()
        Returns the state object representing the WHERE clause.
        Returns:
        Either the actual state object representing the WHERE clause or the null state object since null is never returned
      • hasGroupByClause

        public boolean hasGroupByClause()
        Returns the state object representing the GROUP BY clause.
        Returns:
        Either the actual state object representing the GROUP BY clause or null if it's not present
      • hasHavingClause

        public boolean hasHavingClause()
        Returns the state object representing the HAVING clause.
        Returns:
        Either the actual state object representing the HAVING clause or null if it's not present
      • hasWhereClause

        public boolean hasWhereClause()
        Returns the state object representing the WHERE clause.
        Returns:
        Either the actual state object representing the WHERE clause or null if it's not present
      • parseSelect

        public void parseSelect​(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.
        Parameters:
        jpqlFragment - The portion of the query representing one or several select items
      • removeGroupByClause

        public void removeGroupByClause()
        Removes the GROUP BY clause.
      • removeHavingClause

        public void removeHavingClause()
        Removes the HAVING clause.
      • removeWhereClause

        public void removeWhereClause()
        Removes the WHERE clause.
      • toggleGroupByClause

        public void toggleGroupByClause()
        Either adds or removes the state object representing the GROUP BY clause.
      • toggleHavingClause

        public void toggleHavingClause()
        Either adds or removes the state object representing the HAVING clause.
      • toggleWhereClause

        public void toggleWhereClause()
        Either adds or removes the state object representing the WHERE clause.