Catalogue · articles
The articles live in a Spring Boot service.
Every one must be read through its API.
Spring Boot 3.4, 130 articles
The problem
The API returns a Slice.
- No count query on a large table.
- Only: is there a next page?
What is not changed
The service stays as it is.
- Its API, read only.
- No module, no setting.
What had to be written
pagination: { kind: spring-slice }One line.
- The hub stops on $.last.
- A 21-line connector.
Spring's cap
5000 asked, 2000 served.
- Spring cuts the page without a word.
- The read stops on $.last: 130 of 130.
The trap
A deletion shifts the pages.
- ART-0001 deleted mid-read.
- ART-0051 lands on no page.
The limit
A Slice cannot see it.
- It carries no total.
- The run says Completed, one article short.
The same deletion under the Page
The total moves: the list is read again.
- spring-page checks totalElements (#1796).
- All 128 left are there.