public void openSession(String aConfig) throws Exception {
final String resource = "org/apache/ibatis/submitted/inline_association_with_dot/ibatis-" + aConfig + ".xml";
Reader batisConfigReader = Resources.getResourceAsReader(resource);
SqlSessionFactory sqlSessionFactory;
try {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(batisConfigReader);
} catch(Exception anException) {
throw new RuntimeException("Mapper configuration failed, expected this to work: " + anException.getMessage(), anException);
}
SqlSession session = sqlSessionFactory.openSession();
Connection conn = session.getConnection();
ScriptRunner runner = new ScriptRunner(conn);
runner.setLogWriter(null);
runner.setErrorLogWriter(null);
Reader createScriptReader = Resources.getResourceAsReader("org/apache/ibatis/submitted/inline_association_with_dot/create.sql");
runner.runScript(createScriptReader);
sqlSession = sqlSessionFactory.openSession();
}