use of org.apache.ibatis.domain.blog.mappers.AuthorMapperWithMultipleHandlers in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldFailSelectOneAuthorUsingMapperClassWithTwoResultHandlers.
@Test(expected = BindingException.class)
public void shouldFailSelectOneAuthorUsingMapperClassWithTwoResultHandlers() {
Configuration configuration = new Configuration(sqlMapper.getConfiguration().getEnvironment());
configuration.addMapper(AuthorMapperWithMultipleHandlers.class);
SqlSessionFactory sqlMapperWithMultipleHandlers = new DefaultSqlSessionFactory(configuration);
SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession();
try {
DefaultResultHandler handler1 = new DefaultResultHandler();
DefaultResultHandler handler2 = new DefaultResultHandler();
AuthorMapperWithMultipleHandlers mapper = sqlSession.getMapper(AuthorMapperWithMultipleHandlers.class);
mapper.selectAuthor(101, handler1, handler2);
} finally {
sqlSession.close();
}
}
Aggregations