Fixed
Details
Assignee
Vlad MihalceaVlad MihalceaReporter
Peter HolvenstotPeter HolvenstotFix versions
Priority
Major
Details
Details
Assignee
Vlad Mihalcea
Vlad MihalceaReporter
Peter Holvenstot
Peter HolvenstotFix versions
Priority
Created June 12, 2018 at 4:10 PM
Updated February 24, 2025 at 9:40 AM
Resolved June 26, 2018 at 9:40 AM
Hibernate fails when mapping a one-to-many collection by a field that is not the primary key.
For example, if we have:
Class Parent: Long id, Long collectionKey
Class Child: Long id, Parent parent (key-column of collectionKey)
Hibernate allows this construct using property-ref, and can instantiate objects into the collection, but cannot retrieve them on subsequent connections or once evicted from cache.