-->
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: Cascade Delete question
PostPosted: Mon Aug 31, 2009 2:06 pm 
Newbie

Joined: Mon Aug 31, 2009 2:01 pm
Posts: 1
Hello,

Scenario:
I have a mapped class Foo with a reference to another mapped class Bar.
ie, class Foo has getBar() and setBar()
The cascade on Foo is set to "all".

Question:
If I have an instance of Foo with a reference to an instance of Bar, and then set this reference to null and save the Foo instance, will the Bar instance be deleted from the db or left orphaned in the db?

Thank you,
Evan


Top
 Profile  
 
 Post subject: Re: Cascade Delete question
PostPosted: Tue Sep 01, 2009 4:08 am 
Newbie

Joined: Wed Sep 19, 2007 11:30 pm
Posts: 12
Location: indonesia
yes

_________________
An incredible programmer is worthier than a common programmer because of his/her ideas, not his/her codes.


Top
 Profile  
 
 Post subject: Re: Cascade Delete question
PostPosted: Tue Sep 01, 2009 7:36 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
What does 'null' mean on an association? It really means deleting the association, as opposed to a hard delete on the associated object.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.