AbstractGenericDataSourceItemReaderIntegrationTests {
@Override
protected ItemReader<Foo> createItemReader() throws Exception {
LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
factoryBean.setDataSource(dataSource);
factoryBean.setMappingLocations(new Resource[] { new ClassPathResource("Foo.hbm.xml", getClass()) });
customizeSessionFactory(factoryBean);
factoryBean.afterPropertiesSet();
SessionFactory sessionFactory = factoryBean.getObject();
HibernateCursorItemReader<Foo> hibernateReader = new HibernateCursorItemReader<Foo>();
setQuery(hibernateReader);
hibernateReader.setSessionFactory(sessionFactory);
hibernateReader.setUseStatelessSession(isUseStatelessSession());