[jboss-user] [JBoss jBPM] - Re: Remove or Delete User - Group from Identity store

hosierdm do-not-reply at jboss.com
Tue Jul 18 02:09:41 EDT 2006


As promised, here are the hibernate cascade changes.  All the identity hibernate mapping files I changed can be found in the jBPM source directory src\java.identity\org\jbpm\identity.

In User.hbm.xml, change <set name="memberships" cascade="all"> to <set name="memberships" cascade="all-delete-orphan">

In Group.hbm.xml, change <set name="memberships" cascade="all"> to <set name="memberships" cascade="all-delete-orphan">

In Membership.hbm.xml, change 
<many-to-one name="user" column="USER_" cascade="all" 
  |       foreign-key="FK_ID_MEMSHIP_USR"/>
  | <many-to-one name="group" column="GROUP_" cascade="all" 
  |       foreign-key="FK_ID_MEMSHIP_GRP"/> to <many-to-one name="user" column="USER_" cascade="save-update" 
  |       foreign-key="FK_ID_MEMSHIP_USR"/>
  | <many-to-one name="group" column="GROUP_" cascade="save-update" 
  |       foreign-key="FK_ID_MEMSHIP_GRP"/>

Bear in mind that I have absolutely zero experience with Hibernate.  I was only able to tweak these settings after checking out a website that my boss sent me, which I unfortunately did not bookmark (so I can't pass it along).  But I'm sure a Google search can help elucidate these cascade settings if you have questions about them.  And maybe someone smart like Ronald or Koen might stumble across this and point out that I've done something terribly wrong.  All I know is that these changes worked for me to accomplish what I needed to add to jBPM (running with Oracle10g to boot).  I've added other methods to the IdentitySession class as well if you have any other needs, but you could also try taking a stab at writing the methods based on my example and the others that already exist...which is what I did.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958657#3958657

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958657



More information about the jboss-user mailing list