-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Update set of foreign keys
PostPosted: Fri May 07, 2010 4:41 pm 
Newbie

Joined: Fri May 07, 2010 4:31 pm
Posts: 3
Hello, I am new to Hibernate and I really am enjoying it so far. I do have a question though. So if you have a table A and table B and there is a one-to-many relationship from A to B. So there is a foreign key in B that links to A's primary key. If I get an object in A through my session, the tableADAO object will have a getter for the list of tableBDAO objects. So say that this list of tableBDAO objects, daoList, has 5 objects in it. So I remove a tableBDAO object from that list and save the tableADAO object to the session and commit my session. Why doesn't hibernate recognize that I only want 4 tableBDAO objects in the database now and automatically remove the unwanted tableBDAO object from the database? Right now I have to do a delete in the session to remove the object. I don't know if there is something that I am missing? Thanks,

Dwain


Top
 Profile  
 
 Post subject: Re: Hibernate Update set of foreign keys
PostPosted: Sat May 08, 2010 12:39 am 
Newbie

Joined: Tue Oct 24, 2006 7:47 pm
Posts: 4
Check out http://docs.jboss.org/hibernate/core/3. ... transitive to see if that helps any


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.