There are many permissions, and each role can contain 0 to * permissions. One permission can be in 0 to * roles.
I want the permissions created (if they don't already exist) when I create a new role, but not deleted when I delete a role. Doing work on a Turbine-Castor project so the roles and permissions come from there. Bert. ----- Original Message ----- From: "Bruce Snyder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 17, 2002 2:42 PM Subject: Re: [castor-dev] New child objects in m:n relation not created in Persistent storage when creating new parent > > Bert van Brakel wrote: > > > > Why does castor not create new child objects in persistent storage > > when I create a new parent object? > > > > Example code: > > db.begin(); > > Permission perm1 = new Permission( "perm1" ); > > Permission perm2 = new Permission( "perm2" ); > > Role role = new Role(); > > role.add( perm1 ); > > role.add( perm2 ); > > db.create( role ); <------ > > db.commit(); > > > > Public methods: > > The class Permission has get/set Name and Id (String) > > Role also has get/set Name and Id (String), and get/set > > Permissions (Collection) > > Relationships: > > The Permission class is not dependant on Role. > > There is a m:n relationship between the Role and Permission > > classes. > > > > All works OK if I create the permissions first in persistence storage, > > using a UUID key-genarator (for both Permission and Role), then > > retrieve the permissions from storage and add them to the role. > > Mapping between Role and Permission works OK. > > > > However things don't work fine if I add new permissions to role > > without first creating them in the persistent storage. Is there a way > > I can get castor to do this without making Permissions dependant on > > Role? > > > Bert, > > How are these two object mapped? Does a Permission depend on a Role? > > Bruce > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev