1 Reply Latest reply on Jun 10, 2005 11:54 AM by Stefan Schmidt

    EJB Relationsship for remote and local interfaces

    Lars Monecke Newbie


      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

      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,