2 Replies Latest reply on Sep 1, 2005 12:23 PM by epbernard

    entity inheritance and migration from Preview 5 to Beta 1

    epbernard

      And you code is?
      It is not allowed to have the discriminator column part of the PK, so I don't know wheter we support this case or not.

        • 1. Re: entity inheritance and migration from Preview 5 to Beta
          natanasov

          If I don?t include discriminator column in the primary key and I use composite primary key then JBoss doesn?t include the discriminator to the primary key. In this case I cannot have a two objects that belong to different classes with the same primary key.
          This version supports this feature the problem was in the declaration of primary key class. If the discriminator column is the first field that everything is ok.
          So the class must be declared

          @Embeddable(access = AccessType.FIELD)
          public class ParamCompanyObjectPK extends ObjectPK
          {
           private String tableID;
           private String companyID;
           private String paramID;
          ?
          }
          


          • 2. Re: entity inheritance and migration from Preview 5 to Beta
            epbernard

            Of course an id has to be unique in a class hierarchy! Remember a Cat is essentially an animal so if I query an animal by its id, I need to get only 1 return, not too. That's why the discriminator is not part of the PK