JPA Method
in jakarta.persistence.criteria.Subquery

Subquery<T> having(
  List<Predicate> restrictions
)


Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. Replaces the previously added having restriction(s), if any. If no restrictions are specified, any previously added restrictions are simply removed. This method only overrides the return type of the corresponding AbstractQuery method.
Parameters:
restrictions - a list of zero or more restriction predicates
Return:
the modified query
Since:
JPA 3.2