5 Replies Latest reply on Jul 27, 2006 10:03 AM by Gus Gu

    Session bean inheritance

    Gus Gu Expert

      Hi All,

      I want to whether it is possible to use inheritance in session beans as follows:

      public interface BaseInterface {
       public boolean isNew();
      
       public void destroy();
      }
      
      @Local
      public interface ProjectEditor extends BaseInterface {
       ...
       //other business logic
      }
      
      public class BaseBean implements BaseInterface {
      
       @In(create=true)
       private EntityManager entityManager;
      
       @TransactionAttribute(NOT_SUPPORTED)
       public boolean isNew() {
       return isNew;
       }
      
       @Destroy @Remove
       public void destroy() {}
      
      }
      
      
      
      @Name("projectEditor")
      @Stateful
      public class ProjectEditorBean extends BaseBean implements ProjectEditor {
       ...
       //other business logic
      }

      Thank you in advance for any guidance!
      Gus