Issue with unidirectional one-to-many association with a join column that references a column that is not the primary key

Description

A one-to-many association is causing Hibernate to throw:

when loading an entity via Session.get(domainClass, identifier), under the following conditions:

  • the association collection is annotated with @fetch(FetchMode.JOIN)

  • the association's join column is referencing a non-primary key of the owning entity

  • the association's join column value is referencing a non-existing record of the associated table (the "many" side).

Environment

None

Assignee

Vlad Mihalcea

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure