Migrating to hibernate 6, currently using 6.1.7
And my application fails on startup with error
Unable to build Hibernate SessionFactory; nested exception is org.hibernate.HibernateException: Errors in named queries: ABC, CDE, XYZ…
The most meaningful error is:
Suppressed: org.hibernate.query.SemanticException: Illegal implicit-polymorphic domain path in subquery ‘org.ABCDE’
Looking into named queries we have in the project and the very first reported I think I was able to identify the following query(defined in *.orm.xml)
<query>SELECT abcde FROM org.ABCDE abcde WHERE abcde.id = (SELECT MIN(smallABCDE.id) FROM org.ABCDE smallABCDE)</query>
It was written ages ago, and so survived through a number of hibernate upgrades and now hibernate 6 thinks that query is invalid.
Any suggestion why and what does need to be changed ?
Should I create an issue(can you please point me where & how?), or it is expected behavior ?