Class GroupByClauseStateObject

    • Field Detail


        public static final java.lang.String GROUP_BY_ITEMS_LIST
        Notify the list of StateObjects representing the GROUP BY items.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GroupByClauseStateObject

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

      • addGroupByItem

        public StateObject addGroupByItem​(java.lang.String path)
        Adds the given path as a select item, which can either be an identification variable or a state-field path expression.
        path - Either an identification variable or a state-field path expression
        The StateObject encapsulating the given path
      • getExpression

        public GroupByClause getExpression()
        Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
        Specified by:
        getExpression in interface StateObject
        getExpression in class AbstractStateObject
        The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)
      • parse

        public void parse​(java.lang.String jpqlFragment)
        Parses the given JPQL fragment, which will represent the group by items. The fragment cannot start with the GROUP BY.
        jpqlFragment - The string representation of the group by items
      • setExpression

        public void setExpression​(GroupByClause expression)
        Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.
        expression - The parsed object representing a GROUP BY clause
      • 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