关于SpringbootJPA分页 PageRequest过时的办法

@Override
@Transactional(readOnly = true)  // 只读事务
public Page getPage(Integer pageNum, Integer pageLimit) {
        Pageable pageable =new PageRequest(pageNum - 1,pageLimit);
        return emr.findAll(pageable);
}

 

@Override
@Transactional(readOnly = true)  // 只读事务
public Page getPage(Integer pageNum, Integer pageLimit) {
    Pageable pageable =PageRequest.of(pageNum - 1,pageLimit);
    return emr.findAll(pageable);

}

你可能感兴趣的:(关于SpringbootJPA分页 PageRequest过时的办法)