-->
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.  [ 1 post ] 
Author Message
 Post subject: cascading many-to-many delete
PostPosted: Thu Jun 24, 2004 7:30 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
Hi all,

I have a (user|group)-group relationship, which is many-to-many
and of course one side is mapped reverse ( user|group side )
to prevent double inserts.

respective mapping is:
Code:
    <set name="groupsSet" lazy="true" inverse="true" cascade="none" table="groups">
      <key column="member_id"/>
      <many-to-many column="group_id" class="com.infodesire.user.hibernate.GroupImpl"/>
    </set>
    <subclass discriminator-value="group" name="com.infodesire.user.hibernate.GroupImpl" proxy="com.infodesire.user.hibernate.GroupImpl">
      <set name="membersSet" lazy="true" cascade="none" table="groups">
        <key column="group_id"/>
        <many-to-many column="member_id" class="com.infodesire.user.hibernate.EntityImpl"/>
      </set>
    </subclass>


Now I would like to be able to just remove group or user object
and have all their relationships also removed, but not cascaded to entity on the other side
( removal of user leads to expulsion in all the groups and removal of group does the same )

What cascade option shall I use?

regards,

_________________
Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.