0 Replies Latest reply on Oct 26, 2006 6:13 PM by ekusnitz

    Modifying the class of a persisted entity

    ekusnitz

      I am modifying an application where an ancestor class is persisted before asking the user what type he wants to use, where some types are descendant classes. Once a class is persisted, is it possible to modify the class type to be a descendant class?

      For example,

      class Pet{}

      class Dog extends Pet{}
      .....
      Pet p = new Pet();
      entityManager.persist(p);
      .....
      Dog d = new Pet(p); ???
      entityManager.persist(d);

      In general, I can't find a lot of information about how to use inheritance withc EJB3. Can anyone point me to some good links?
      TIA