Hello,

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);
to the local interface ProjectLocal.

Here is an extract of my ejb-jar.xml
  <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>

No problem at all. Works fine.

Now i added for both entities a remote interface and home. Opps? What should i 
do with the cmr-field  reponsible. I can't change the return type of the 
function getResponsible.
Should i duplicate all the stuff and added a new cmr-field responsible? I don't 
think so, but how could i handle this? Is there a design pattern or an example?

If you need more code, please give me a hint.

Thanks in advance,

Lars.


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3881036#3881036

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3881036


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to