3 Replies Latest reply on Apr 26, 2004 11:46 AM by sesques

    Local or Remote interface?

    Julien Martin Expert

      Hello,

      I have a EJB called EstablishmentEJB that has a relation with another EJB called CountryEJB. An establishment has a country and a country has several establishments. I have both local and remote interfaces. What's more I have a reference to the CountryEJB in my EstablishmentEJB as follows:

      package com.softwareag.test_guide.establishment;
      
      import java.util.Collection;
      
      import javax.ejb.EntityBean;
      import javax.ejb.EntityContext;
      
      import com.softwareag.test_guide.country.CountryLocal;
      
      /**
       * @author Julien Martin
       */
      public abstract class EstablishmentBean implements EntityBean {
      
       public Integer ejbCreate(
       Integer id,
       String name,
       Collection visitorComments,
       Collection grades,
       CountryLocal country,//here
       Collection categories) {
       setId(id);
       setName(name);
       setVisitorComments(visitorComments);
       setGrades(grades);
       setCountry(country);
       setCategories(categories);
       return null;
       }
       public void ejbPostCreate(
       Integer id,
       String name,
       Collection visitorComments,
       Collection grades,
       CountryLocal country,
       Collection categories) {}
      
       //Persistence fields
       public abstract Integer getId();
       public abstract void setId(Integer id);
       public abstract String getName();
       public abstract void setName(String name);
      
       //Relation fields
       public abstract Collection getVisitorComments();
       public abstract void setVisitorComments(Collection visitorComments);
       public abstract Collection getGrades();
       public abstract void setGrades(Collection grades);
       public abstract CountryLocal getCountry();
       public abstract void setCountry(CountryLocal country);
       public abstract Collection getCategories();
       public abstract void setCategories(Collection categories);
      
       //Callback methods
       public void setEntityContext(EntityContext ec) {}
       public void unsetEntityContext() {}
       public void ejbLoad() {}
       public void ejbStore() {}
       public void ejbActivate() {}
       public void ejbPassivate() {}
       public void ejbRemove() {}
      
      }
      


      My question is: do I need to reference the Local or Remote interface at the line named //here?

      Thanks in advance,

      Julien Martin.