Persisting and loading an entity with a null all-delete-orphan collection results in error
Description
Attachments
1
Activity
Show:

Andrea Boriero June 5, 2024 at 7:30 AM
Hi ,
I tried the test you provided with 6.5.2 and it passes.

Israel Rios June 4, 2024 at 7:34 PM
This problem reappeared on 6.5.2.
When persisting ant entity Parent with a collection children, mapped as all-delete-orphan, set to null and then loading the same entity in a query results in:
org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: org.hibernate.bugs.domain.Parent.children
When children is non null the problem doesn’t happen.
Sample code:
Persisting and querying:
Test case attached.