I have a system with two Entity beans, User and Module. And a User can have a certain permission to a Module. That means, the two entities have a relation, and this relation has a "permission" field attached to it.
My question is how to model this, is it possible to define a relation with the extra field, or do I have to set up this using a special UserPermission-bean?
Regards
Johan
-
Entity relation with an attached value field (3 messages)
- Posted by: Johan Persson
- Posted on: October 04 2004 04:40 EDT
Threaded Messages (3)
- Entity relation with an attached value field by Kingshuk Bandyopadhyay on October 06 2004 09:57 EDT
- Entity relation with an attached value field by David Jones on October 06 2004 12:37 EDT
- Entity relation with an attached value field by Kingshuk Bandyopadhyay on October 07 2004 09:45 EDT
- Entity relation with an attached value field by David Jones on October 06 2004 12:37 EDT
-
Entity relation with an attached value field[ Go to top ]
- Posted by: Kingshuk Bandyopadhyay
- Posted on: October 06 2004 09:57 EDT
- in response to Johan Persson
I have a system with two Entity beans, User and Module. And a User can have a certain permission to a Module. That means, the two entities have a relation, and this relation has a "permission" field attached to it.My question is how to model this, is it possible to define a relation with the extra field, or do I have to set up this using a special UserPermission-bean?Regards Johan
I would have another entity bean called UserModule that has a field called permission and would relate User--UserModule and UserModule--Module with CMR.
Kingshuk -
Entity relation with an attached value field[ Go to top ]
- Posted by: David Jones
- Posted on: October 06 2004 12:37 EDT
- in response to Kingshuk Bandyopadhyay
Of course at this point you may also want to ask yourself how come such a simple requirement led to the complexity of three Entity Beans.
David -
Entity relation with an attached value field[ Go to top ]
- Posted by: Kingshuk Bandyopadhyay
- Posted on: October 07 2004 09:45 EDT
- in response to David Jones
Of course at this point you may also want to ask yourself how come such a simple requirement led to the complexity of three Entity Beans.David
:-) I get the point. May be I missed something obvious. Can you suggest something else ?
My assumption was a user can have access to more than one module, and permission for each module could be different.
If user has access to only one module then permission could be a field in the User bean itself and the CMR is between User and Module.