-->
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: Removing many-to-one
PostPosted: Fri Nov 09, 2007 10:14 am 
Newbie

Joined: Thu Oct 18, 2007 1:29 pm
Posts: 3
Hello, I have three tables, A, AB, and B. The way they are relationed is the next:

A has an one-to-many with AB.
AB has many-to-one with A and other with B.
B has an one-to-many with AB.

When I remove an object of class A, it also delete all of class AB (what is correct), but the problem comes when it deletes all of class B. I don't want all the Bs to be deleted, because there can be another AB relationed with those Bs. What I mean is something like delete-orphan for many-to-one relations (I know that it is not supported).

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 10, 2007 10:11 am 
Newbie

Joined: Tue Nov 06, 2007 10:55 am
Posts: 3
Location: Netherlands
you might want to try a many-to-many relationship.
This only deletes entries in table AB


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.