title: Exception "org.hibernate.PersistentObjectException" in Hibernate
body: <p>I use in my project Hibernate. And have error when the server start:</p>
  
  <blockquote>
    <p>org.hibernate.PersistentObjectException: detached entity passed to persist</p>
  </blockquote>
  
  <p>Following "autorization" code:</p>
  
  <pre><code>   @Id
  @Column(name = "id")
  @GeneratedValue(strategy = GenerationType.IDENTITY) 
  private long id;
  
  @Column(name = "login", unique = true, updatable = false)
  private String name;
  
  //Important to Hibernate!
  @SuppressWarnings("MySQLConfig")
  public UsersDataSet() {
  }
  
  @SuppressWarnings("MySQLConfig")
  public UsersDataSet(long id, String name) {
      this.setId(id);
      this.setName(name);
  }
  
  public UsersDataSet(String name) {
      this.setId(-1);
      this.setName(name);
  }
  </code></pre>
  
  <p>Please, explain me, where am I wrong?</p>