Estou tentando usar o Spring com Hsqldb, mas estou tendo problemas para setar as propriedades corretas na classe JPAConfiguration. Vou colocar como está abaixo:
public class JPAConfiguration {
@Bean //gerenciável pelo Spring
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean FactoryBean =
new LocalContainerEntityManagerFactoryBean();
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
FactoryBean.setJpaVendorAdapter(vendorAdapter);
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUsername("SA");
dataSource.setPassword("");
dataSource.setUrl("jdbc:hsqldb:hsql://localhost/casadocodigo");
dataSource.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
FactoryBean.setDataSource(dataSource);
Properties props = new Properties();
props.setProperty("javax.persistence.jdbc.driver", "org.hsqldb.jdbc.JDBCDriver");
props.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
props.setProperty("hibernate.show_sql", "true");
props.setProperty("hibernate.hbm2ddl.auto", "update");
FactoryBean.setJpaProperties(props);
FactoryBean.setPackagesToScan("br.com.casadocodigo.loja.models");
return FactoryBean;
}
}