Subqueries in WITH/ON clause that reference other join nodes lead to invalid duplicate joins.
The HQL query:
Previously generated the following SQL:
As of 5.4.24 it instead produces:
The difference is:
I have a reproducer available at https://github.com/hibernate/hibernate-orm/compare/master...jwgmeligmeyling:reproducers-blaze-persisence-1237?expand=1
Duplicate of