With we can join classes that don't have any assosiation. Anyway, if the joined class further joins its assosiations, the join clause is missing in the generated SQL. For example this HQL:
generates SQL like this:
Order is joined, OrderItem is not. Note that the item id column alias is there.
Implicit join doesn't work as well (see HHH-10503).
If the second join used ON clause, it works fine. This most probably applies for subsequent joins as well, thus, once the ON clause is used, we cannot go back to joining assosiations. HQL that works:
I am attaching few tests to check the behaviour. If I knew where to start, I might try to create a patch as well.
This is a duplicate of which already got fixed for 5.2.6 and will also be fixed in 5.1.4