使用Jpa来实现分页功能
Jpa 中的SQL语句
public interface <类名> extends JpaRepository<表的实例化,String> {
@Query(value = "SELECT * FROM <表名> ",nativeQuery = true)
Page<表的实例化> pageAll(Pageable pageable);
}
在控制台中的代码
@RequestMapping("/####")
public String ####(HttpServletResponse response,Integer pageNum