在一个项目中看到这样的一个用法:
PageHelper.startPage(pageNum,pageSize);
PageInfo pageInfo = new PageInfo(productList);
pageInfo.setList(productListVoList);
疑问是:
PageInfo不是已经对结果进行包装了吗,为什么还需要一个setList?
在此插件的官网没有看到这种用法:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md
直接强转就行了。Page<Product> page = (Page)productList;