setGrouping(group) - JDO Query's method

void setGrouping(
  String group

Set the grouping expressions, optionally including a "having" clause. When grouping is specified, each result expression must either be an expression contained in the grouping, or an aggregate evaluated once per group.
group - a comma-delimited list of expressions, optionally followed by the "having" keyword and a boolean expression
JDO 2.0

This documentation page is derived (with some adjustments) from the JDO 2.2 API
and is available under the terms of the Apache License, v. 2.0.