JPA Method
in javax.persistence.criteria.CriteriaQuery

CriteriaQuery<T> groupBy(
  Expression<?>... grouping
)


Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides the return type of the corresponding AbstractQuery method.
Parameters:
grouping - zero or more grouping expressions
Return:
the modified query
Since:
JPA 2.0