-->
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: many-to-many inverse remove problem
PostPosted: Fri Dec 10, 2004 9:05 am 
Newbie

Joined: Fri Dec 10, 2004 6:35 am
Posts: 2
I have a bidirectional many to many relationship
between tables user and role

the inverse attribute is set to true in role.hbm.xml
the inverse attribute is set to false in role.hbm.xml
cascade is set to all for both

I can add/remove a role to a user with sess.update (user)

I can add a user to a role with sess.update(role)

But I can't remove a user from a role with sess.update(role)
It seems hibernate updates role, but doesn't delete the
association in the user_role table

Did I miss something or do I have to use the 'not-inverse'
end (user) to remove the association .

(I'm working with detached objects through stateless EJB)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 10, 2004 9:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
are you using detached object?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: many-to-many inverse remobe problem
PostPosted: Mon Dec 13, 2004 5:28 am 
Newbie

Joined: Fri Dec 10, 2004 6:35 am
Posts: 2
Yes I'm using detached objects


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.