use of org.apache.ibatis.datasource.unpooled.UnpooledDataSource in project mybatis-3 by mybatis.
the class ResultMapExtendsTest method getSqlSessionFactoryJavaConfig.
private SqlSessionFactory getSqlSessionFactoryJavaConfig() throws Exception {
Configuration configuration = new Configuration();
Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
configuration.setEnvironment(environment);
configuration.addMapper(ResultMapReferencePersonMapper.class);
configuration.addMapper(ResultMapReferencePetMapper.class);
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration);
initDb(sqlSessionFactory);
return sqlSessionFactory;
}
Aggregations