Search in sources :

Example 1 with PageDataLoader

use of com.mendmix.mybatis.plugin.pagination.PageExecutor.PageDataLoader in project jeesuite-libs by vakinge.

the class BaseMybatisTest method testPage.

@Test
public void testPage() {
    Page<UserEntity> pageInfo;
    UserEntity example = new UserEntity();
    example.setType((short) 1);
    PageParams pageParams = new PageParams(1, 10, new OrderBy("name"));
    pageInfo = PageExecutor.pagination(pageParams, new PageDataLoader<UserEntity>() {

        @Override
        public List<UserEntity> load() {
            return userMapper.selectByExample(example);
        }
    });
    System.out.println(pageInfo);
}
Also used : OrderBy(com.mendmix.common.model.OrderBy) PageParams(com.mendmix.common.model.PageParams) PageDataLoader(com.mendmix.mybatis.plugin.pagination.PageExecutor.PageDataLoader) UserEntity(com.mendmix.mybatis.test.entity.UserEntity) Test(org.junit.Test)

Aggregations

OrderBy (com.mendmix.common.model.OrderBy)1 PageParams (com.mendmix.common.model.PageParams)1 PageDataLoader (com.mendmix.mybatis.plugin.pagination.PageExecutor.PageDataLoader)1 UserEntity (com.mendmix.mybatis.test.entity.UserEntity)1 Test (org.junit.Test)1