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:
@@ -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)
|
||||
Reference in New Issue
Block a user