Did Hibernate 5 reuse the root query’s a.entityB join in the subquery too? If that’s what you’re trying to achieve, I think using the join’s alias in the subquery is the only correct syntax. I also believe that 6 behaves correctly, it creates a new (cross) join for the subquery since you’re specifying the full a.entityB.reference path: with a being in the root query, we can’t reuse its joins for correlated subqueries. |