Joining unrelated class first, than assosiation

Description

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).

Workaround:
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.

Environment

None

Activity

Show:
Christian Beikov
December 30, 2016, 9:37 AM

This is a duplicate of which already got fixed for 5.2.6 and will also be fixed in 5.1.4

Assignee

Christian Beikov

Reporter

Vit Novak

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure