Invalid SQL generated when using explicit and implicit joins

Description

When trying to upgrade my application form Hibernate 4.2.15 to 4.2.25, Hibernate started to generate invalid queries (at least PostgreSQL says so) – maybe due to HHH-9305. The following is stripped down repro-steps. Please find attached the maven project reproducing the issue.

repro steps
  • Entities: Book, Shelve, Author, Address with quite natural relationships

    • Book one-to-many Shelve

    • Book one-to-many Author

    • Author one-to-many Address

  • query

Generated SQL (reformatted, commented):

Error when running on PostgreSQL

Interestingly. this does not fail on H2, but I think PostgreSQL is right here.

Environment

PostgreSQL 9.5.4

Assignee

Unassigned

Reporter

Piotr Findeisen

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