Wrong binding of @ManyToOne for non-PK associations

Description

This one is quite obscure, the problem is most likely in BinderHelper#createSyntheticPropertyReference().

A many-to-one foreign key association that doesn't reference a primary key, but a unique key:

Throws an exception when you query Items:

Note that this is one of those rare use cases for "property-ref" in XML binding.

Environment

None

Assignee

Unassigned

Reporter

Christian Bauer

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor
Configure