Hibernate,hibernate.hbm2ddl.auto

时间:2016-03-22 13:05:27

标签: hibernate

我有一个问题,当我设置hibernate.hbm2ddl.auto = create但是表没有创建

@Bean
public Properties hibernateProperties() {
    Properties properties = new Properties();
    properties.put("hibernate.dialect", hibernateDialect);
    properties.put("hibernate.show_sql", hibernateShowSql);
    properties.put("hibernate.hbm2ddl.auto", hibernateHBM2DDLAuto);
    properties.put("hibernate.format_sql", hibernateFormatSql);

    return properties;
}
@Bean
@SuppressWarnings("deprecation")
public SessionFactory sessionFactory() {
    return new LocalSessionFactoryBuilder(dataSource())
            .scanPackages("model")
            .addProperties(hibernateProperties())
            .buildSessionFactory();
}
hibernate.hbm2ddl.auto=create
hibernate.show_sql=false
hibernate.format_sql=true

0 个答案:

没有答案