1 Reply Latest reply on Nov 20, 2006 4:16 AM by Toni Beckman

    @Inheritance(strategy= InheritanceType.JOINED)

    Toni Beckman Novice

      Hi,

      my intention is to extend one entity bean from another using the JOINED stategey. I have a very simple setup, which produces the following exception:

      jectName: persistence.units:ear=calc.ear,jar=calc.jar,unitName=userDatabase
      State: FAILED
      Reason: org.hibernate.AnnotationException: Unable to define/override @Id(s) on a subclass: de.test.Client
      I Depend On:
      jboss.jca:service=ManagedConnectionFactory,name=calcDS
      Depends On Me:
      jboss.j2ee:ear=calc.ear,jar=calc.jar,name=RegisterAction,service=EJB3

      Here is the source code of the two entity beans:

      @Entity
      @Inheritance(strategy= InheritanceType.JOINED)
      public class Person
      {
      @Id
      public String lastname;

      String firstName;
      String street;
      String zipcode;
      String city;
      String country;
      String phone;
      ...
      }


      @Entity
      public class Client extends Person
      {
      @Id
      String hostname;

      String email;
      String customernumber;
      ...
      }

      Why is this not working?

        • 1. Solved
          Toni Beckman Novice

          Hi,

          I figured it out mylsef. First of all you should remove the "hostname" property from the subclass.

          But then also all entity beans have to be Serializable. Is this required by the offical sepcifiaction from SUN?