title: Inserting id column in new table
body: <p>I have situation like this.</p>
  <ol>
  <li>I need to read data from a table. Let's say this table is called <code>Person_Old</code> and has three columns</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/WoSNC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WoSNC.png" alt="enter image description here" /></a></p>
  <ol start="2">
  <li>I need to read the data from <code>Person_Old</code> and to save in another table called <code>Person_New</code>. In the <code>Person_New</code> table, I need to insert an extra column called <code>ID</code>. So in the <code>Person_New</code> table, I have a total of 4 columns.</li>
  </ol>
  <p>The new table should be like this:</p>
  <p><a href="https://i.stack.imgur.com/lhlmt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lhlmt.png" alt="enter image description here" /></a></p>
  <ol start="3">
  <li><p>I have a Java class Called Person. where i have three fields firstname, lastname and dateOfBirth. Now if i insert another field called id like below</p>
  <p>@ID</p>
  <p>@GeneratedValue</p>
  <p>private Long id;</p>
  </li>
  </ol>
  <p>then I get an error</p>
  <blockquote>
  <p>Invalid column name ID</p>
  </blockquote>
  <p>So now my question is how to insert this <code>id</code> column in my java class and in the SQL script for creating <code>Person_new</code> table so that when I run the program it'll read the data from old table and while persisting data in new table it'll generate Ids for each entry.</p>
  <p>I would be grateful for your suggestions. Thank you.</p>