HIbernate generates wrong query with multiple joins for MySQL 5.7,Unknown column 'join table column' in 'on clause'

Description

There are three entities representing class, teacher and student like this:

The JPQL:

This JPQL execute failure cause by "Unknown column 'eteacher3_.name_' in 'on clause'",the alias name "eteacher3_" has been used before declared.
The generate sql:

The correct sql should be like this:

Environment

hibernate 5.0.11&5.2.9,MySQL5.7

Assignee

Unassigned

Reporter

lu jijiang

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.0.11

Affects versions

Priority

Blocker
Configure