title: Hibernate and Postgresql autoincrement not syncing
body: <p>I'm having a problem with Hibernate and Postgres.   I'm repeating through a code block for testing purposes to make sure everything is working properly.  This code block, however, includes repeat persist methods to persist two user accounts to the useraccount table.  It works properly the first time. However, every subsequent time I run the code, the UserAccount objects IDs are incremented, while their corresponding users in the table stay at their original values.  I've tried using <code>native</code> and <code>identity</code> as the generator class, <code>identity</code> keeps the id at <code>0</code> and <code>native</code> has the same issue I've described above.  </p>
  
  <p>I realize this is an unrealistic circumstance (repeating through an identical codeblock) but I don't feel that this is performing as it should.  In fact, after removing all entries from all tables, the users are added to the user table properly. Is there a way to ensure that he object property id syncs with the table id?</p>
  
  <p>Here is the xml mapping for the useraccount ids.</p>
  
  <pre><code>&lt;class name="UserAccount" table="useraccounts"&gt;
      &lt;id name = "UserId" type="int" column="user_id" unsaved-value="null"&gt;
          &lt;generator class="increment"/&gt;
      &lt;/id&gt;
  </code></pre>
  
  <p>And here is the Hibernate config file</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;!DOCTYPE hibernate-configuration SYSTEM
      "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
   &lt;hibernate-configuration&gt;
   &lt;session-factory&gt;
      &lt;property name="hibernate.dialect"&gt;
          org.hibernate.dialect.PostgreSQL82Dialect
      &lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;
          org.postgresql.Driver
      &lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;
         jdbc:postgresql://localhost:5432/agora-db
      &lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;
          postgres
      &lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;
          postgres
      &lt;/property&gt;
      &lt;property name="connection_pool_size"&gt;1&lt;/property&gt;
      &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
      &lt;mapping resource="hibernate.hbm.xml"/&gt;
  
   &lt;/session-factory&gt;
   &lt;/hibernate-configuration&gt;
  </code></pre>