ManyToMany referencing unique key doesn't work

Description

Mapping a `@ManyToMany` association doesn't work when using non-primary key columns like in the following

It fails with Duplicate property mapping of _org_hibernate_model_Animal_relatives found in org.hibernate.model.Animal. I debugged a little and it seems two synthetic properties with the same name are created. Maybe the synthetic property generation fails to see that source and target are the same so it doesn't have to generate two synthetic properties?

Environment

None

Assignee

Unassigned

Reporter

Christian Beikov

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