1 Reply Latest reply on Feb 24, 2006 9:53 AM by aidan davis

    Non-persistant base classs with persistent properties

    treespace Novice

      I have a package of classes that all share a common base class Model. The Model implements Serializable and houses a few common values important values:

      public class Model implements Serializable
      long id; // primary key
      Timestamp version; // optimistic locking aid
      boolean deleted; // "soft" delete

      The property access methods are in the derived models because they have annotations @Id, @Version and @Column for each of these. In a real POJO those accessors would be in the base Model class.

      How can I persist base class properties from within the subclass?