[hibernate-issues] [JIRA] (HHH-14102) orphanRemoval behaviour differ from lazy to eager loading
Florian Kern (JIRA)
jira at hibernate.atlassian.net
Thu Jul 9 07:24:53 EDT 2020
Florian Kern ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ee102ca96beaa0aae0970ea ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZWI1ZjE5MzBlODAyNGFhNmE3MTI1ZDdjYTQ3MjU5ZDciLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14102?atlOrigin=eyJpIjoiZWI1ZjE5MzBlODAyNGFhNmE3MTI1ZDdjYTQ3MjU5ZDciLCJwIjoiaiJ9 ) HHH-14102 ( https://hibernate.atlassian.net/browse/HHH-14102?atlOrigin=eyJpIjoiZWI1ZjE5MzBlODAyNGFhNmE3MTI1ZDdjYTQ3MjU5ZDciLCJwIjoiaiJ9 ) orphanRemoval behaviour differ from lazy to eager loading ( https://hibernate.atlassian.net/browse/HHH-14102?atlOrigin=eyJpIjoiZWI1ZjE5MzBlODAyNGFhNmE3MTI1ZDdjYTQ3MjU5ZDciLCJwIjoiaiJ9 )
Change By: Florian Kern ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ee102ca96beaa0aae0970ea )
In a @ oneToMany relation you have different behaviours if you removing a children from the collection.
If you remove a children from a fetched collection, the children wouldnt will not be removed deleted from the database.
If your collection is lazy fetched, the children would will be deleted from the database.
See attached Testcase for example. Execute via
{code:java}
mvn test
{code}
( https://hibernate.atlassian.net/browse/HHH-14102#add-comment?atlOrigin=eyJpIjoiZWI1ZjE5MzBlODAyNGFhNmE3MTI1ZDdjYTQ3MjU5ZDciLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14102#add-comment?atlOrigin=eyJpIjoiZWI1ZjE5MzBlODAyNGFhNmE3MTI1ZDdjYTQ3MjU5ZDciLCJwIjoiaiJ9 )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100133- sha1:bf400b0 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200709/62c22b99/attachment.html
More information about the hibernate-issues
mailing list