6 Replies Latest reply on May 5, 2005 2:17 PM by Emmanuel Bernard

    Inheritance: Single Table Strategy

    Mike Duffy Novice

      I understand the "Inheritance: Single Table Strategy" strategy presented in the EJB-3.0_Preview_5 tutorial. The DiscriminatorColumn, "ANIMAL_TYPE", is used to determine if the table row represents a CAT or a DOG.

      What if I do not want to discriminate between subclasses, but I just want to use inheritance to discriminate between a parent and a single subclass? For example, if I have a table with ten columns that represents Users, and I want to use only four of these columns in a class called, UserDisplayItem, how would I do this in the EJB-3.0_Preview_5?

      In EJB-3.0_Preview_4, I could simply make the entity annotations in each class and uses "extends". This does not work in EJB-3.0_Preview_5.

      Any suggestions?