pagination: Spring Data JPA Page vs Slice vs keyset Window scrolling, with the SQL and REST shapes

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4bLvQVbZweAqqf54x
This commit is contained in:
Claude
2026-11-16 11:13:56 +05:30
parent e3d1b550ae
commit 91938727f2
42 changed files with 1446 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
# Page<Product> findByCategory("books", PageRequest.of(1, 10, Sort.by("id")))
select p1_0.id,p1_0.category,p1_0.name,p1_0.price from product p1_0 where p1_0.category=? order by p1_0.id offset ? rows fetch first ? rows only
select count(*) from product p1_0 where p1_0.category=?
statements: 2, rows: 10, totalElements: 25, totalPages: 3, hasNext: true
# Slice<Product> findSliceByCategory("books", PageRequest.of(1, 10, Sort.by("id")))
select p1_0.id,p1_0.category,p1_0.name,p1_0.price from product p1_0 where p1_0.category=? order by p1_0.id offset ? rows fetch first ? rows only
statements: 1, rows: 10, hasNext: true (no totalElements exists on a Slice)
# List<Product> findListByCategory("books", PageRequest.of(1, 10, Sort.by("id")))
select p1_0.id,p1_0.category,p1_0.name,p1_0.price from product p1_0 where p1_0.category=? order by p1_0.id offset ? rows fetch first ? rows only
statements: 1, rows: 10 (no total, no hasNext)