title: nonuniqueobjectexception on default ID generation in hibernates
body: <p>Following code is throwing : <strong><code>nonuniqueobjectexception</code></strong> .</p>
  
  <p>However when I use:
  <strong>@GeneratedValue(strategy=GenerationType.IDENTITY)</strong> every thing starts working fine.</p>
  
  <pre><code>@Entity
  @Table(name="CART")
  public class Cart {
  
      @Id
      @Column(name="cart_id")
      private long id;
  
  
  @Entity
  @Table(name="ITEMS")
  public class Items {
  
      @Id
      @Column(name="id")
      private long id;
  </code></pre>
  
  <p>I want to understand why it is failing with default ID generation strategy of hibernates.</p>