Spring Boot List转Page(完整支持Pageable, Sort)
Spring Data通常采用Page作为分页对象,@PageableDefault Pageable作为入参,通过JPA查询能自动实现分页,但有些缓存场景中会直接查询出List然后手动排序,分页封装成Pape,于是就写了个小工具方便处理。package com.leo.boot.jpa.stream;import org.apache.commons.collections4.CollectionUtils;import org.apache.commons.collections4.Iter
原创
2021-08-10 21:35:16 ·
1966 阅读 ·
0 评论