Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagehelper + tk.mapper #32

Closed
KsAlone opened this issue Apr 10, 2018 · 1 comment
Closed

pagehelper + tk.mapper #32

KsAlone opened this issue Apr 10, 2018 · 1 comment

Comments

@KsAlone
Copy link

KsAlone commented Apr 10, 2018

pagehelper 和 tk.mapper一起使用时,我想分页,然后根据实体类里面的某些参数进行条件查询(有的条件是相等,有些条件是like),所以我使用了example查询,但是报错【There is no getter for property named 'distinct' in 'class tk.mybatis.mapper.entity.Example$Criteria'】

@KsAlone
Copy link
Author

KsAlone commented Apr 10, 2018

我的代码
Example example = new Example(CmsTarget.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo(cmsTarget);
criteria.andLike("cmsTargetName", "%" + cmsTarget.getCmsTargetName() + "%");
PageHelper.startPage(1, 10);
Page list = (Page) cmsTargetMapper.selectByExample(criteria);
PageInfo pageInfo = new PageInfo(list);

@KsAlone KsAlone closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant