How To Implement Pagination Via ROW_NUMBER()
Window Function
Description: This application is an example of using ROW_NUMBER()
(and COUNT(*) OVER()
for counting all elements) window function to implement pagination.
Key points:
- use a native query relying on
ROW_NUMBER()
- we don't return a page as
Page
orSlice
, we return it asList
, thereforePageable
is not used