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.
Entities: Book, Shelve, Author, Address with quite natural relationships
Book one-to-many Shelve
Book one-to-many Author
Author one-to-many Address
Generated SQL (reformatted, commented):
Error when running on PostgreSQL
Interestingly. this does not fail on H2, but I think PostgreSQL is right here.