-->
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.  [ 4 posts ] 
Author Message
 Post subject: Remove one side in bi-directional many-to-many relationship
PostPosted: Thu Jul 20, 2006 9:29 am 
Newbie

Joined: Thu Jul 20, 2006 9:02 am
Posts: 2
Hibernate version:3.2

I need to be able to remove just one side in a bi-directional many-to-many relationship between a user table and a role table.
If I do session.delete( user ) followed by a flush(), I then want the user to be deleted (as well as the association table data), but not the role.

# If I use cascade=none and then tries to delete a user that has a number of roles, I get an exception: Counld not execute JDBC batch update

If I use cascade=all-delete-orphan and then tries to delete a user that has a number of roles, Hibernate than deletes the user object, the role object and a row in the association table.


Thanx in advance


Top
 Profile  
 
 Post subject: I have the same problem
PostPosted: Thu Jul 27, 2006 10:29 am 
Newbie

Joined: Thu Jul 27, 2006 10:26 am
Posts: 4
Hello

I am facing the same problem
did u get any reply or any soluution ??
Please mail me dekatern@gmail.com

Thanks in advance.
Rahul


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 2:06 pm 
Newbie

Joined: Thu Jul 27, 2006 2:04 pm
Posts: 4
use save-update in cascade


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 2:17 pm 
Newbie

Joined: Thu Jul 27, 2006 10:26 am
Posts: 4
the real problm is ..

deleting the side which doesn't maintain the association

http://forum.hibernate.org/viewtopic.ph ... highlight=

your input is welcome


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