title: Spring-JPA-Hibernate Configuration: setting property hiberate.hbm2dll.auto to create has no effect?
body: <p>I have this configuration problem:</p>
  
  <p>1) I have jpaPropertyMap with property hibernate.hbm2dll.auto set to create but it has no effect. Its not creating table generation SQL.</p>
  
  <p>I can see in log file other jpaPropertyMap property like dialect getting properly set so property map is being read.</p>
  
  <p>2) If i set HibernateJpaVendorAdapter's property generateddl to true, table is being generated.</p>
  
  <p>so why does hibernate.hbm2dll.auto not working in the case/generating tables.</p>
  
  <p>Here is the Configuration file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:context="http://www.springframework.org/schema/context"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans       http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"&gt;
  
      &lt;context:annotation-config /&gt;
      &lt;context:component-scan base-package="org.demoapps.placementwebsite"/&gt;
  
      &lt;bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt;
  
      &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/cpm?autoReconnect=true" /&gt;
          &lt;property name="username" value="user" /&gt;
          &lt;property name="password" value="password" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="entityManagerFactory"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
          &lt;property name="persistenceUnitName" value="punit" /&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="jpaVendorAdapter"&gt;
              &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
                  &lt;property name="showSql" value="true" /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
  
          &lt;property name="jpaPropertyMap"&gt;
              &lt;map&gt;
                  &lt;entry key="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" /&gt;
                  &lt;entry key="hibernate.hbm2dll.auto" value="create"/&gt;
                  &lt;entry key="hibernate.format_sql" value="true" /&gt;
              &lt;/map&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
          &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Using:
  Hibernate 4.2.2.Final
  Spring 3.2.3.RELEASE</p>