I followed the development of Spring Boot and sometimes between the original version 0.0.5-BUILD-SNAPSHOTand the current version that I use. 1.0.0.RC1I no longer run my import.sqlscript.
Here is my configuration for LocalContainerEntityManagerandJpaVendorAdapter
@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;
}
Interestingly, it hibernate.hbm2ddl.autostill works, which, I think, is part of my definitionSpringBootServletInitializer
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {
However, I also noticed that the generated tables no longer have underlining and change their shape when generating?
However, this may be the result of updating my version org.postgresqlas follows:
Earlier:
<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>
I also had to change pggetserialsequenceto pg_get_serial_sequenceto run the script from pgadmin?
, , , , , import.sql.
: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa
import.sql 1.0.0-BUILD-SNAPSHOT