use of org.apache.ibatis.domain.blog.mappers.BlogMapper in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldSelectAllPostsUsingMapperClass.
@Test
void shouldSelectAllPostsUsingMapperClass() {
try (SqlSession session = sqlMapper.openSession()) {
BlogMapper mapper = session.getMapper(BlogMapper.class);
List<Map> posts = mapper.selectAllPosts();
assertEquals(5, posts.size());
}
}
use of org.apache.ibatis.domain.blog.mappers.BlogMapper in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldLimitResultsUsingMapperClass.
@Test
void shouldLimitResultsUsingMapperClass() {
try (SqlSession session = sqlMapper.openSession()) {
BlogMapper mapper = session.getMapper(BlogMapper.class);
List<Map> posts = mapper.selectAllPosts(new RowBounds(0, 2), null);
assertEquals(2, posts.size());
assertEquals(1, posts.get(0).get("ID"));
assertEquals(2, posts.get(1).get("ID"));
}
}
use of org.apache.ibatis.domain.blog.mappers.BlogMapper in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldOffsetAndLimitResultsUsingMapperClass.
@Test
void shouldOffsetAndLimitResultsUsingMapperClass() {
try (SqlSession session = sqlMapper.openSession()) {
BlogMapper mapper = session.getMapper(BlogMapper.class);
List<Map> posts = mapper.selectAllPosts(new RowBounds(2, 3));
assertEquals(3, posts.size());
assertEquals(3, posts.get(0).get("ID"));
assertEquals(4, posts.get(1).get("ID"));
assertEquals(5, posts.get(2).get("ID"));
}
}
Aggregations