-
1. Re: How to delete Memberships
jimknopf Mar 13, 2007 6:20 AM (in response to jimknopf)Come on, is there realy no one who can help me?
I think it must be possible by deleting the Membership on the Database with this:"delete from org.jbpm.identity.Membership as m where m.id = ?1 "
and delete the Membership from the User and Group Object in JBPM
...
BUT
I can't remove a Membership from a User
the Group Objects have.setMemberships( memberships );
but the User Objects has only .addMembership( ... )
------
I didn'T find a way :( -
2. Re: How to delete Memberships
olivier_debels Mar 13, 2007 7:10 AM (in response to jimknopf)
Can't you let hibernate take care of this?
I mean you can do Session.delete(membership)...
Haven't tried it though. -
3. Re: How to delete Memberships
jimknopf Mar 14, 2007 8:53 AM (in response to jimknopf)The deleting on the Database is not realy the Problem.
The Problem is, that the Memberships are still in use by other Objects like User and Group whitch are have a Hash-Table of there memberships.
And the User didn't have a methode to delete a Membership. Only Group have setMemberships. The User have only addMembership :( -
4. Re: How to delete Memberships
olivier_debels Mar 14, 2007 8:58 AM (in response to jimknopf)
I thought that doing a session.delete of a membership will also remove this membership out of the collections in user and group.
This because the membership is a hibernate object and calling delete removes the object from the session (so also from the mapped collection in the same hibernate session).
But like I said I didn't really try that. -
5. Re: How to delete Memberships
jimknopf Mar 19, 2007 4:45 AM (in response to jimknopf)Thanks for the fast answer, and sorry for the delay but i was ill.
Hmm, after thinking a little about it, i think u are right and Hibernate will manage this for me.
Thank u