Skip to content

Commit 7224449

Browse files
committed
Add PageList convert to Page
1 parent c0081de commit 7224449

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/main/java/org/springframework/data/ebean/util/Converters.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,17 @@ public static <T> Page<T> convertToSpringDataPage(PagedList<T> pagedList, Sort s
6868
PageRequest.of(pagedList.getPageIndex(), pagedList.getPageSize(), sort),
6969
pagedList.getTotalCount());
7070
}
71+
72+
/**
73+
* Convert Ebean pagedList Sort to Spring data Page.
74+
*
75+
* @param pagedList
76+
* @param <T>
77+
* @return
78+
*/
79+
public static <T> Page<T> convertToSpringDataPage(PagedList<T> pagedList) {
80+
return new PageImpl<T>(pagedList.getList(),
81+
PageRequest.of(pagedList.getPageIndex(), pagedList.getPageSize()),
82+
pagedList.getTotalCount());
83+
}
7184
}

0 commit comments

Comments
 (0)