We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
PageInfo<MemberCard> objectPageInfo = PageMethod.startPage(1, 10) .doSelectPageInfo(() -> baseMapper.getXxxx() ); List<MemberCard> list = objectPageInfo.getList(); if (CollectionUtils.isEmpty(list)) { PageInfo empty = PageInfo.EMPTY; log.warn("hashCode:{}",empty.hashCode()); List<MemberCard> pageList = empty.getList(); pageList.add(new MemberCard()); empty.setList(pageList); empty.setTotal(pageList.size()); log.warn("Total:{}",empty.getTotal()); return empty; }
SELECT count(0) FROM member_card where 1=2
PageInfo.EMPTY 永远返回空对象
17:47:06.804 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2 17:47:06.805 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters: 17:47:06.811 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1 17:47:06.812 WARN c.w.l.u.s.xxxxx - hashCode:1045255393 17:47:06.812 WARN c.w.l.u.s.xxxxx - Total:3 17:47:16.582 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2 17:47:16.583 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters: 17:47:16.589 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1 17:47:16.590 WARN c.w.l.u.s.xxxxx - hashCode:1045255393 17:47:16.590 WARN c.w.l.u.s.xxxxx - Total:4 17:47:16.820 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2 17:47:16.821 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters: 17:47:16.827 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1 17:47:16.827 WARN c.w.l.u.s.xxxxx - hashCode:1045255393 17:47:16.828 WARN c.w.l.u.s.xxxxx - Total:5 17:47:17.015 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2 17:47:17.016 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters: 17:47:17.022 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1 17:47:17.024 WARN c.w.l.u.s.xxxxx - hashCode:1045255393 17:47:17.024 WARN c.w.l.u.s.xxxxx - Total:6 17:47:17.282 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2 17:47:17.283 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters: 17:47:17.290 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1 17:47:17.292 WARN c.w.l.u.s.xxxxx - hashCode:1045255393 17:47:17.292 WARN c.w.l.u.s.xxxxx - Total:7
PageInfo 类的EMPTY 属性是static final 只能赋值一次,全局只有一个,但暴露的方法可以被内部和外部修改,
public static final PageInfo EMPTY = new PageInfo(Collections.emptyList(), 0);
The text was updated successfully, but these errors were encountered:
来个PR?
Sorry, something went wrong.
修改bug pagehelper#779
be523bc
Merge pull request #780 from xiao8Git/5.3.3
8182846
修改bug #779
No branches or pull requests
测试代码
原 SQL
期望的结果:
PageInfo.EMPTY 永远返回空对象
日志内容
17:47:06.804 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2
17:47:06.805 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters:
17:47:06.811 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1
17:47:06.812 WARN c.w.l.u.s.xxxxx - hashCode:1045255393
17:47:06.812 WARN c.w.l.u.s.xxxxx - Total:3
17:47:16.582 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2
17:47:16.583 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters:
17:47:16.589 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1
17:47:16.590 WARN c.w.l.u.s.xxxxx - hashCode:1045255393
17:47:16.590 WARN c.w.l.u.s.xxxxx - Total:4
17:47:16.820 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2
17:47:16.821 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters:
17:47:16.827 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1
17:47:16.827 WARN c.w.l.u.s.xxxxx - hashCode:1045255393
17:47:16.828 WARN c.w.l.u.s.xxxxx - Total:5
17:47:17.015 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2
17:47:17.016 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters:
17:47:17.022 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1
17:47:17.024 WARN c.w.l.u.s.xxxxx - hashCode:1045255393
17:47:17.024 WARN c.w.l.u.s.xxxxx - Total:6
17:47:17.282 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Preparing: SELECT count(0) FROM member_card where 1=2
17:47:17.283 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - ==> Parameters:
17:47:17.290 DEBUG c.w.l.u.s.m.M.xxxXx_COUNT - <== Total: 1
17:47:17.292 WARN c.w.l.u.s.xxxxx - hashCode:1045255393
17:47:17.292 WARN c.w.l.u.s.xxxxx - Total:7
原因
PageInfo 类的EMPTY 属性是static final 只能赋值一次,全局只有一个,但暴露的方法可以被内部和外部修改,
The text was updated successfully, but these errors were encountered: