Search in sources :

Example 1 with AuthorMapperWithRowBounds

use of org.apache.ibatis.domain.blog.mappers.AuthorMapperWithRowBounds in project mybatis-3 by mybatis.

the class SqlSessionTest method shouldFailSelectOneAuthorUsingMapperClassWithTwoRowBounds.

@Test(expected = BindingException.class)
public void shouldFailSelectOneAuthorUsingMapperClassWithTwoRowBounds() {
    Configuration configuration = new Configuration(sqlMapper.getConfiguration().getEnvironment());
    configuration.addMapper(AuthorMapperWithRowBounds.class);
    SqlSessionFactory sqlMapperWithMultipleHandlers = new DefaultSqlSessionFactory(configuration);
    SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession();
    try {
        RowBounds bounds1 = new RowBounds(0, 1);
        RowBounds bounds2 = new RowBounds(0, 1);
        AuthorMapperWithRowBounds mapper = sqlSession.getMapper(AuthorMapperWithRowBounds.class);
        mapper.selectAuthor(101, bounds1, bounds2);
    } finally {
        sqlSession.close();
    }
}
Also used : AuthorMapperWithRowBounds(org.apache.ibatis.domain.blog.mappers.AuthorMapperWithRowBounds) DefaultSqlSessionFactory(org.apache.ibatis.session.defaults.DefaultSqlSessionFactory) DefaultSqlSessionFactory(org.apache.ibatis.session.defaults.DefaultSqlSessionFactory) AuthorMapperWithRowBounds(org.apache.ibatis.domain.blog.mappers.AuthorMapperWithRowBounds) BaseDataTest(org.apache.ibatis.BaseDataTest) Test(org.junit.Test)

Aggregations

BaseDataTest (org.apache.ibatis.BaseDataTest)1 AuthorMapperWithRowBounds (org.apache.ibatis.domain.blog.mappers.AuthorMapperWithRowBounds)1 DefaultSqlSessionFactory (org.apache.ibatis.session.defaults.DefaultSqlSessionFactory)1 Test (org.junit.Test)1