title: How to create and handle composite primary key in JPA
body: <p>I want to have versions from the same data entry. In other words, I want to duplicate the entry with another version number.</p>
  
  <p><code>id - Version</code> will be the primary key. </p>
  
  <p>How should the entity look like? How can I duplicate it with another version?</p>
  
  <pre><code>id Version ColumnA
  
  1   0      Some data
  1   1      Some Other data
  2   0      Data 2. Entry
  2   1      Data
  </code></pre>