title: Force hibernate to leave id empty
body: <p>So I am using Postgres and Hibernate 4.2.2 and with entity like this</p>
  
  <pre><code>@Entity(name = "Users")
  @Check(constraints = "email ~* '^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+[.][A-Za-z]+$'")
  @DynamicInsert
  public class Users {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_user",unique = true)
    @Index(name = "user_pk")
    private Integer idUser;
  </code></pre>
  
  <p>Hibernate still inserts some id that is already in the table, instead of leaving it emtpy for the database to fill it in. Also hibernate forces ids based on its cache not even checking the database whether it has the lates id.</p>
  
  <p>How can I force it so I can leave id blank and let the database insert it?</p>
  
  <p>First I thought it was because I was using <code>int</code> and that <code>int</code> is by default 0 but even when using object it just forces the id there from its cache.</p>
  
  <p>So my goal is to let the database fill the ids instead of hibernate or at least Hibernate before filling it in to check the database for id first.</p>