Adding an EntityGraph (containing an attribute annotated with @OrderBy) hint to a Criteria Query that defines a groupBy but no orderBy causes the ORDER clause to be inserted before the GROUP clause in the tree, therefore causing the SqlGenerator to (rightfully) ignore the GROUP clause when converting the tree to SQL.
Test case included to the best of my ability in the PR. |
|