title: Hibernate's 'hbm2ddl.auto' property with value 'create' is not re-creating table
body: <p>I'm working on my <a href="http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch01.html#tutorial-firstapp" rel="nofollow">first simple Hibernate application</a>. The crux of the problem is, I had renamed a member of persistent class (with apt changes to all other parts) and re-run the application. As 'hbm2ddl.auto' property is assigned 'create' value in configuration xml, Hibernate is expected to create new table on every run but, it's not doing so. Following is detailed information:</p>
  
  <p>CLASS: <br></p>
  
  <pre><code>    public class Event {
      private Long id;
  
      private String title;
      private Date date;
  
      public Event() {
          // this form used by Hibernate
      }
  
      public Event(String title, Date date) {
          // for application use, to create new events
          this.title = title;
          this.date = date;
      }
  
      public Long getId() {
          return id;
      }
  
      private void setId(Long id) {
          this.id = id;
      }
  
      public Date getDate() {
          return date;
      }
  
      public void setDate(Date date) {
          this.date = date;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  }
  </code></pre>
  
  <p>Event.hbm.xml: <br></p>
  
  <pre><code>&lt;hibernate-mapping package="org.hibernate.tutorial.hbm"&gt;
  
  &lt;class name="Event" table="EVENTS"&gt;
      &lt;id name="id" column="EVENT_ID"&gt;
          &lt;generator class="increment"/&gt;
      &lt;/id&gt;
      &lt;property name="date" type="timestamp" column="EVENT_DATE"/&gt;
      &lt;property name="title"/&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p></p>
  
  <p>hibernate.cfg.xml, among others, has following entry: <br></p>
  
  <pre><code>&lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  </code></pre>
  
  <p>MAIN CLASS: <br></p>
  
  <pre><code>public class EventManager {
  
  public static void main(String[] args) {
  
      EventManager mgr = new EventManager();
  
      List events = mgr.listEvents();
  for (int i = 0; i &lt; events.size(); i++) {
      Event theEvent = (Event) events.get(i);
          System.out.println( "Event: " + theEvent.getTitle() + " Time: " + theEvent.getDate() );
      }
  
      HibernateUtil.getSessionFactory().close();
  
  }
  
  private List listEvents() {
      Session session = HibernateUtil.getSessionFactory().getCurrentSession();
      session.beginTransaction();
      List result = session.createQuery("from Event").list();
      session.getTransaction().commit();
      return result;
  } }
  </code></pre>
  
  <p>The above code is working as expected. Just to test 'hbm2ddl.auto' property, I had changed 'title' member in Event class to 'title1'. And, updated setter and getter methods and all references (in mapping xml, Event and EventManager class). Complied with no errors. But, when I try to run the application, I see following exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" org.hibernate.exception.SQLGrammarException: Unknown column 'event0_.title1' in 'field list'
        at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
        at $Proxy6.executeQuery(Unknown Source)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
        at org.hibernate.loader.Loader.doQuery(Loader.java:829)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
        at org.hibernate.loader.Loader.doList(Loader.java:2438)
        at org.hibernate.loader.Loader.doList(Loader.java:2424)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2254)
        at org.hibernate.loader.Loader.list(Loader.java:2249)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1248)
        at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
        at org.hibernate.tutorial.hbm.EventManager.listEvents(EventManager.java:56)
        at org.hibernate.tutorial.hbm.EventManager.main(EventManager.java:20)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'event0_.title1' in 'field list'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.Util.getInstance(Util.java:384)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
        ... 16 more</p>
  </blockquote>
  
  <p>The error is pointing to EventManager class at following line:</p>
  
  <pre><code>List result = session.createQuery("from Event").list();
  </code></pre>
  
  <p>As 'hbm2ddl.auto' property is assigned 'create' value in configuration xml, Hibernate is expected to create new table on every run but, it's not doing so. Please help resolve the problem.</p>
  
  <p>Thanks in advance.</p>