我一直在关注 Spring Boot 的开发,有时在初始版本之间0.0.5-BUILD-SNAPSHOT
以及我当前使用的版本1.0.0.RC1
我不再运行我的import.sql
script.
这是我的配置LocalContainerEntityManager
and JpaVendorAdapter
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
DataSource dataSource, JpaVendorAdapter jpaVendorAdapter) {
LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
lef.setDataSource(dataSource);
lef.setJpaVendorAdapter(jpaVendorAdapter);
lef.setPackagesToScan("foo.*");
return lef;
}
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
hibernateJpaVendorAdapter.setShowSql(true);
hibernateJpaVendorAdapter.setGenerateDdl(true);
hibernateJpaVendorAdapter.setDatabase(Database.POSTGRESQL);
return hibernateJpaVendorAdapter;
}
有趣的是hibernate.hbm2ddl.auto
似乎仍在运行,我认为这是我的定义的一部分SpringBootServletInitializer
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {
但是,我也注意到生成的表不再有下划线并在生成时改变了它们的形状?
然而,这可能是更新我的结果org.postgresql
版本如下:
之前:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1004-jdbc41</version>
</dependency>
Now:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1100-jdbc41</version>
</dependency>
我也不得不改变pggetserialsequence
to pg_get_serial_sequence
让脚本完全运行pgadmin
?
我想我对发生的事情感到困惑,但最重要的是我想回到我的状态import.sql
run.
我一直在关注示例项目:https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa
还有他们的import.sql
也没有运行在1.0.0-BUILD-SNAPSHOT