1. Problems
Use the PageHelper plug-in for paging, SSM projects, and use Mabatis' dynamic proxy.
When querying the manager table,
//分页查找
public Page queryManagersByPage(int currentPage, int pageSize) throws IOException {
SqlSession session = genenalMapper.useSqlSession();
ManagerMapper mm = genenalMapper.getMapper(session, ManagerMapper.class);
Page<Object> page = PageHelper.startPage(currentPage, pageSize);
List<Manager> list = mm.queryManagers();
return page;
}
//Page查询元素为空,但是调试过程中数据库表中数据有2条,但是返回page和list为[null][null];
**2.原因**
Manager的实体类与数据库表中字段不一致
3. Solve
and then modify the Manager class of JavaBean, and then re-debugging, success!!!