Server which does not support columns in the select list if not contained in the "group by" clause, fail when grouping by entity.
For example, this fails on SQL Server 2012 (but succeed in H2):
The generated query is:
which fails with this error:
Column 'dbo.Bar.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
In H2 the same query doesn't fail, because it supports additional columns in the select list if those columns are known to be "dependent" on the grouped ones.
SQL Server 2012