PageHelper plugin: You can query the total number of data, but the page shows that all elemetns are null

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的实体类与数据库表中字段不一致

insert image description here
3. Solve
insert image description here
and then modify the Manager class of JavaBean, and then re-debugging, success!!!

Guess you like

Origin blog.csdn.net/qq_44464101/article/details/116594564