/* private helper methods */
@SuppressWarnings("cast")
private SessionFactory getSessionFactory(DataSource dataSource) throws Exception {
LocalSessionFactoryBean factory = new LocalSessionFactoryBean();
factory.setDataSource(dataSource);
factory.setMappingLocations(new Resource[] {
new ClassPathResource("org/springframework/webflow/persistence/TestBean.hbm.xml"),
new ClassPathResource("org/springframework/webflow/persistence/TestAddress.hbm.xml") });
factory.afterPropertiesSet();
return (SessionFactory) factory.getObject();
}