"QueryException: could not resolve property" when upgrading from 5.3.15 to 5.4.x

Description

Hi Hibernate Team,

I´m facing a strange error when upgrading Hibernate from 5.3.15 to 5.4.X. The query

starts to fail with

I´ve created the following repo for reproducing the issue https://github.com/Fabian-K/hibernate-issue. I tried to strip down the project as much as possible. The code works fine when using 5.3.15, it however fails with 5.4.x (I tested 5.4.0 and 5.4.12). You can reproduce it using mvn test.

It seems to be related to the use of Composite IDs for the Middle class. I already noticed that it works when

  • renaming Middle.key to Middle.id and MiddleId.key to MiddleId.id

  • not using a Composite ID for Middle

  • using b.middle.target.id instead of b.middle.target.field in the where condition

Do you have any idea/hint about what is going on in this case?

Thanks, Fabian

Environment

None

Assignee

Unassigned

Reporter

Fabian

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.15

Affects versions

Priority

Major
Configure