-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: JPA merge with DELETE_ORPHAN
PostPosted: Mon Aug 15, 2011 11:10 pm 
Newbie

Joined: Mon Aug 15, 2011 11:02 pm
Posts: 1
I have an entity which contains a @OneToMany Set with
Code:
cascade=CascadeType.ALL
and
Code:
@Cascade(DELETE_ORPHAN)
I need to update the parent entity (and all of its descendants) using entityManager.merge(...) because the entire object graph is detached. The entity is updated, and the set of child items is first cleared, and then new ones are added. The merge appears to work as requested, but the next time the entity is queried, the removed items from the set are still there (and the new ones are not)!

Am I to understand that DELETE_ORPHAN will not work on a merge with detached entities?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.