Error message:
Cannot invoke "org.hibernate.sql.ast.tree.from.TableGroup.findTableGroupJoin(org.hibernate.sql.ast.tree.from.TableGroup)" because "parentParentTableGroup" is null
java.lang.NullPointerException: Cannot invoke "org.hibernate.sql.ast.tree.from.TableGroup.findTableGroupJoin(org.hibernate.sql.ast.tree.from.TableGroup)" because "parentParentTableGroup" is null
Discovered while upgrading a spring-boot+jpa app from 3.0.7 to 3.1.0, which upgrades Hibernate from 6.1.7 to 6.2.2. See testcase H8BugTest for a reproducer (the project also contains ways to trigger this from a spring-boot app, but the mentioned one should be good enough). The testcase findStreet which uses a CriteriaQuery to fetch a Street works on all versions. The testcase findAddress which uses a CriteriaQuery to fetch an Address breaks on 6.2.2+, but works on 6.1.7. Address has a simple use of inheritance, which seems to be the trigger of the problem. Versions of Hibernate to use can be controlled from gradle.properties. hibernate-bug2.zip |