title: Hibernate aren't creating my tables in database
body: <p>In the current state my Spring/Maven project, I have two entity classes which should br created in my postgresql database. The Hibernate configuration class is this:</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @PropertySource({ "classpath:database.properties" })
  @ComponentScan({ "spring.webapp.persistence" })
  public class HibernateConfig {
  
     @Autowired
     private Environment env;
  
     @Bean
     public LocalSessionFactoryBean sessionFactory() {
        LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
        sessionFactory.setDataSource(restDataSource());
        sessionFactory.setPackagesToScan(new String[] { "spring.webapp.persistence.model" });
        sessionFactory.setHibernateProperties(hibernateProperties());
  
        return sessionFactory;
     }
  
     @Bean
     public DataSource restDataSource() {
        BasicDataSource dataSource = new BasicDataSource();
        dataSource.setDriverClassName(env.getProperty("jdbc.driverClassname"));
        dataSource.setUrl(env.getProperty("jdbc.url"));
        dataSource.setUsername(env.getProperty("jdbc.user"));
        dataSource.setPassword(env.getProperty("jdbc.pass"));
  
        return dataSource;
     }
  
     @Bean
     @Autowired
     public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
        HibernateTransactionManager txManager = new HibernateTransactionManager();
        txManager.setSessionFactory(sessionFactory);
  
        return txManager;
     }
  
     @Bean
     public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
        return new PersistenceExceptionTranslationPostProcessor();
     }
  
     Properties hibernateProperties() {
        return new Properties() {
           /**
           * 
           */
          private static final long serialVersionUID = 1L;
  
          {
              setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
              setProperty("hibernate.dialect", env.getProperty("hibernate.dialect"));
              setProperty("hibernate.globally_quoted_identifiers", "true");
           }
        };
     }
  }
  </code></pre>
  
  <p>my file database.properties is:</p>
  
  <pre><code>jdbc.driverClassname=org.postgresql.Driver
  jdbc.url=jdbc:postgresql://localhost:5432/maven_test?charSet=LATIN1
  jdbc.user=klebermo
  jdbc.pass=123
  hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
  hibernate.show_sql=true
  hibernate.hbm2ddl.auto=create-drop
  </code></pre>
  
  <p>I add the postgresql jdbc driver via pom.xml, with this:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;postgresql&lt;/groupId&gt;
    &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
    &lt;version&gt;9.1-901.jdbc3&lt;/version&gt;
    &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Anyone can see what's wrong with this setting? Because none table is being created in the database when I run the application.</p>