-->
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.  [ 3 posts ] 
Author Message
 Post subject: Set cascade="delete" question
PostPosted: Tue Mar 30, 2010 9:55 am 
Regular
Regular

Joined: Wed Mar 10, 2010 4:48 am
Posts: 106
I have objects A and B and a join-table C.
A and B have a set of C.
If I add cascade delete to these sets, will the relation be deleted or the object related to?


Top
 Profile  
 
 Post subject: Re: Set cascade="delete" question
PostPosted: Tue Mar 30, 2010 12:03 pm 
Newbie

Joined: Mon Mar 29, 2010 1:12 am
Posts: 4
When you set cascade="delete" you're going to delete the objects C, if no other object is holding a reference to C, but in your case A and B are both holding a reference to C so if you try to delete an object C from A and B is referencing that object C a exception will be thrown.


Top
 Profile  
 
 Post subject: Re: Set cascade="delete" question
PostPosted: Tue Mar 30, 2010 12:27 pm 
Regular
Regular

Joined: Wed Mar 10, 2010 4:48 am
Posts: 106
Thanks, does anyone has a suggestion how to solve this?


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

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.