Hello, 

Does anyone have a working Many to Many CMR example ? 

Additionally, are there any words of advice as to how to implement a 
users & groups scheme for J2EE (JBoss) with XDoclet ? 

Here is what I have done and where I got stuck: 

I have the most standard Users and Groups configuration: 
User Table       Group Table         Permissions Table
----------       -----------        -------------------
USERNAME (PK)    GROUPNAME (PK)        USERNAME (references USER ) 
PASSWORD         DESCRIPTIN            GROUPNAME (references GROUP )

As per Ed Roman's "Mastering EJB 2" book, I decided to go with the 
approach of splitting my Many:Many CMR relation into 2 N:1 relations

I have a User EJB, a Group EJB, and a Permission EJB , 
with an ejb.relation from User (1) to Permission (many) 
and an ejb.relation from Group (1) to Permission (many) 

all is well in my code, and when I deploy I get the database schema 
created exactly as desired. But here is where I got stuck : 

The code generated for UserCMP and GroupCMP creates a new PermissionLocal 
in each of their addPermission ( PermissionValue ) methods. 

So, I cannot possibly add the same Permission object to 2 different 
EJBs because they each will create a new row with the FK of the other set 
to NULL . 

So I'm wondering , how to do this ? I couldnt find any code examples of a 
M:N CMR with a mapping table using XDoclet. 

Any advice ? Am I going the wrong direction with this (very standard) 
problem ? Any other solutions for User-Group patterns in EJB ? 

Thanks in Advance, 

Nathaniel 






-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to