1 Reply Latest reply on Mar 12, 2002 7:27 AM by Marcus Brito

    CMP and EJBObject

    Yan Or Newbie

      I have successfully created 2 CMP EJBs with a one-to-one
      relationship between them. Both beans have a local
      interface and a local home interface. Now I decide that
      I need to expose the entity beans to remote clients
      (I know it's not recommended but...). How do I do that?
      I can create remote interfaces and remote home interfaces
      but what should the CMR accessor return, the remote or
      the local interface?

      Here's the code:

      public interface ALocal implements EJBLocalObject {
      ...
      public BLocal getB();
      public void setB(BLocal b);
      }

      public interface BLocal implements EJBLocalObject {
      ...
      }

      public interface A implements EJBObject {
      ...
      public B??? getB();
      public void setB(B??? b);
      }

      Thanks,
      Yan

        • 1. Re: CMP and EJBObject
          Marcus Brito Novice

          First, let me warn you: You should never, ever expose local objects to remote methods. It simply won't work. If you really need their *data* exposed, write a value object and return it.

          Now your question: CMR are always defined in terms of local interfaces. They always takes and returns local interfaces.