0 Replies Latest reply on Sep 29, 2002 8:34 PM by Ignacio de Cordoba

    Inheritance with EJBs (no "containment") ;-)

    Ignacio de Cordoba Novice

      Hi there,
      I have read an interesting article on EJB Inheritance in theserverside.com
      http://www.theserverside.com/resources/article.jsp?l=EJBInheritance

      I wonder if all this "containment" is really needed because as someone noted in the related article forum, it is not the same to implement inheritance that to represent it... as I see it, this article solution just makes a way of representing a EJB inheritance structure, but not being really inheritance.

      Entity Beans are not so important as they usuallly just map SQL tables (anyway, Implementation Bean class can't be extended as validation will fail if ejbCreate method return different primary key types)

      I've been experimenting with pramati studio and wonder why one can't just extend regular (remote) and local interfaces (in place of extending javax.ejb.EJBLocalObject). This way, in the lookup client code (a javabean, JSP page, ...) you can refer to the parent or derived class without any problem.

      With session beans you can even extend implementation bean class, as ejbCreate is void type. Validation doesn't fail.

      I am facing just one problem... parent classes belong to a jar file not included in my project, so when deploying the derived classes, code generation fails... container generator can't find parent classes. I guess I must put them somewhere in the container (parent classes are never deployed, of course... they are just extended and must be in the compiler classpath)
      Where can I put this jar files so that container compiler finds them when generating the deploying classes?
      I've tried server/lib/ext/ but still doesn't find them. Do I have to include this classes manually in the classpath?

      Thanks,
      Ignacio