factoryBean.setDataSource(createTestDataSource());
Resource[] mappingLocations = new ClassPathResource[] {
new ClassPathResource("Account.hbm.xml", Account.class),
new ClassPathResource("Beneficiary.hbm.xml", Beneficiary.class) };
factoryBean.setMappingLocations(mappingLocations);
factoryBean.afterPropertiesSet();
return (SessionFactory) factoryBean.getObject();
}
private DataSource createTestDataSource() {
Resource schemaLocation = new ClassPathResource("/rewards/testdb/schema.sql");