title: How to generate ID only if it's null on persisting
body: <p>I have two different components that use two different DB's but the entity is on both DB's and I want it to have the same ID's always.</p>
  <p>So basically when the ID is null I want it to be auto generated, if it's not null use the ID.</p>
  <p>I'm using hibernate.</p>
  <pre class="lang-java prettyprint-override"><code>@Id
  @Column(name = COLUMN_ID, unique = true, nullable = false)
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getId() {
      return id;
  }
  </code></pre>
  <p>Any suggestions?</p>