When we use composite keys the generated sql is incompatible in the majority of rdbms.
If i look at [IdentCode.java|https://raw.githubusercontent.com/hibernate/hibernate-orm/master/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java] i don't understand how it might works. The resolveAsAlias method is inadeguate for catch all the cases.
For example with composite keys the following jpql queries will fails:
select count(distinct e) form entity -->(SQL) select count(distinct id_part1, id_part2 ) from entity
select e from entity where e exists (select ee from entity as ee) -->(SQL) select id_part1, id_part2 from entity where (id_part1, id_part2) exists (select (id_part1, id_part2) from entity)
select e, count from entity e group by e ([HHH-1615|https://hibernate.atlassian.net/browse/HHH-1615])
Moreover |
|