Class GroupByClause

  • All Implemented Interfaces:
    Expression

    public final class GroupByClause
    extends AbstractExpression
    The GROUP BY construct enables the aggregation of values according to the properties of an entity class.
    BNF: groupby_clause ::= GROUP BY groupby_item {, groupby_item}*

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

      • GroupByClause

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

      • buildCollectionExpression

        public CollectionExpression buildCollectionExpression()
        Creates a new CollectionExpression that will wrap the single group by item.
        Returns:
        The single group by item represented by a temporary collection
      • getActualIdentifier

        public String getActualIdentifier()
        Returns the actual GROUP BY found in the string representation of the JPQL query, which has the actual case that was used.
        Returns:
        The GROUP BY identifier that was actually parsed
      • getGroupByItems

        public Expression getGroupByItems()
        Returns the Expression that represents the list of group by items if any was parsed.
        Returns:
        The expression that was parsed representing the list of items
      • hasGroupByItems

        public boolean hasGroupByItems()
        Determines whether the list of items was parsed.
        Returns:
        true if at least one item was parsed; false otherwise
      • hasSpaceAfterGroupBy

        public boolean hasSpaceAfterGroupBy()
        Determines whether a whitespace was found after GROUP BY.
        Returns:
        true if there was a whitespace after GROUP BY; false otherwise