title: Hibernate - how to generate id manually?
body: <p>I am working on data migration from one db to a new one in Java.
  One of my issues are that I must keep the same id values of the entities.</p>
  
  <p>I know it's possible to change the id generator, but I need to set the id manually.
  Each entity I create using Map from old object to a new one and I just set values.
  can't I just set manually something like:</p>
  
  <pre><code>Map&lt;String, Object&gt; newEntity = new HashMap&lt;String, Object&gt;()
  newEntity.setId(oldEntity.get("id"))
  </code></pre>