title: Is it possible to build a JPA entity by extending a POJO?
body: <p>Lets say I have the following POJO:</p>
  
  <pre><code>public class MyThing {
   private int myNumber;
   private String myData;
  //assume getter/setter methods
  }
  </code></pre>
  
  <p>Is it now possible to extend this POJO as a JPA entity?</p>
  
  <pre><code>@Entity
  @Table(name = "my_thing")
  public class MyThingEntity extends MyThing implements Serializable {
   @Column(name = "my_number")
   //?????????
   @Column(name = "my_data")
   //????????
  }
  </code></pre>
  
  <p>I want to keep the POJO separate from the JPA entity. The POJO lives in a different project and is often used without a persistence layer, my project wants to persist it in a database and do so without the overhead of mapping from a POJO to an entity and back.</p>
  
  <p>I understand that JPA entities are POJOs, but in order to use it I would have to include a library that implements javax.persistence and the other projects using the same base object have no use for a persistence layer.</p>
  
  <p>Is this possible? Is this a good idea?</p>