sorry if this FAQ, i have searched with no satifised result, probaly wrong search words..
I use JBoss 4.0 and ejb 2 and cmp.
I have two entities Project (classes: ProjectLocal, ProjectLocalHome, ProjectEJB) and User (classes: UserLocal, UserLocalHome, UserEJB). The one to many releationsship between both is "project has responsible user".
Modelling all with local interface is no problem an works fine. I have added
public abstract UserLocal getResponsible(); public abstract void setResponsible(UserLocal user);
<relationships> <ejb-relation> <ejb-relation-name>Project-User</ejb-relation-name> <ejb-relationship-role> <ejb-relationship-role-name>project-has-responsible-user</ejb-relationship-role-name> <multiplicity>Many</multiplicity> <relationship-role-source> <ejb-name>ProjectEJB</ejb-name> </relationship-role-source> <cmr-field> <cmr-field-name>responsible</cmr-field-name> </cmr-field> </ejb-relationship-role> <ejb-relationship-role> <ejb-relationship-role-name>user-is-responsible-for-project</ejb-relationship-role-name> <multiplicity>One</multiplicity> <relationship-role-source> <ejb-name>UserEJB</ejb-name> </relationship-role-source> </ejb-relationship-role> </ejb-relation> </relationships>
CMR can only be used with local interfaces.