title: How to store snapshot of a spring JPA entity in a new table with new primary key column
body: <p>I have couple of entities, Person and PersonSnapshot. PersonSnapshot is same as Person, except for, it has its own primary key. </p>
  
  <p>I would like use Java class hierarchy so that I need not redefine property names, but I am not able to get them to work as the two tables will have different "@Id" properties.</p>
  
  <pre><code>    @Entity
      @Table(name = "Person")
      @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
      class Person {
         @Id
         private int id;
         @name
         private String name;
     }
  </code></pre>
  
  <p>I need to store its snapshot as in</p>
  
  <pre><code>@Entity
  @Table(name = "Person_Snapshot")
  class PersonSnapshot extends Person {
       @Id
       private int snapShotId;
  }
  </code></pre>
  
  <p>I don't want to create an abstract MappedSuperClass for common attributes as I will end up with 3 classes. Is there any way achieve the same result with just these two classes ?</p>