[hibernate-issues] [JIRA] (HHH-14079) Orphan removal does not work on session.update function

Ali Hopyar (JIRA) jira at hibernate.atlassian.net
Fri Jun 19 07:46:56 EDT 2020


Ali Hopyar ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Add96fccc-1289-4d99-810b-5723cdd171e2 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNWQ5YTZmYzhlNTg1NDc4MWJiODk1OTc3NTlmMDRjMjEiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14079?atlOrigin=eyJpIjoiNWQ5YTZmYzhlNTg1NDc4MWJiODk1OTc3NTlmMDRjMjEiLCJwIjoiaiJ9 ) HHH-14079 ( https://hibernate.atlassian.net/browse/HHH-14079?atlOrigin=eyJpIjoiNWQ5YTZmYzhlNTg1NDc4MWJiODk1OTc3NTlmMDRjMjEiLCJwIjoiaiJ9 ) Orphan removal does not work on session.update function ( https://hibernate.atlassian.net/browse/HHH-14079?atlOrigin=eyJpIjoiNWQ5YTZmYzhlNTg1NDc4MWJiODk1OTc3NTlmMDRjMjEiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.4.15 Assignee: Unassigned Components: hibernate-core, hibernate-entitymanager Created: 19/Jun/2020 04:46 AM Priority: Major Reporter: Ali Hopyar ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Add96fccc-1289-4d99-810b-5723cdd171e2 )

Let's say I have two entites like

@Entity(name = "Parent" )
@Table(name = "parent" )
public class Parent {

   @Transient
   private SomePOJO transient ;

   @OneToMany(mappedBy = "parent" , cascade = CascadeType.All, orphanRemoval = true )
   private List<Child> children;

   //getters, setters and other fields
}

@Entity(name = "Child" )
@Table(name = "child" )
public class Child {

   @ManyToOne
   private Parent parent;

   //getters, setters and other fields
}

When I call session.update with parent entity, orphanRemoval does not have any affect. I does not delete child entity and relationship between parent and child

( https://hibernate.atlassian.net/browse/HHH-14079#add-comment?atlOrigin=eyJpIjoiNWQ5YTZmYzhlNTg1NDc4MWJiODk1OTc3NTlmMDRjMjEiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14079#add-comment?atlOrigin=eyJpIjoiNWQ5YTZmYzhlNTg1NDc4MWJiODk1OTc3NTlmMDRjMjEiLCJwIjoiaiJ9 )

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#100130- sha1:5f5b10c )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200619/05931070/attachment.html 


More information about the hibernate-issues mailing list