The following test is a variation of the test given in the first comment on
NH-2560. This test fails, because the generated SQL includes all properties from the customer in the select clause, which of course isn't allowed since we are only grouping on the customer's id. Not sure if this is an important case, but to get it working would require a subquery to be generated.
The flawed SQL: