Skip to content

Commit

Permalink
Merge pull request #79 from njr-11/error-when-database-cannot-do-keys…
Browse files Browse the repository at this point in the history
…et-pagination

Define error for when database cannot do keyset pagination
  • Loading branch information
otaviojava authored Nov 16, 2022
2 parents 2ccbb84 + f2d3d36 commit 2603399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@
* count of pages are not accurate when keyset pagination is used and should
* not be relied upon.</p>
*
* <h2>Database Support for Keyset Pagination</h2>
*
* <p>A repository method with return type of <code>KeysetAwareSlice</code> or
* {@link KeysetAwarePage} must raise {@link UnsupportedOperationException}
* if the database is incapable of keyset pagination.
* </p>
*
* @param <T> the type of elements in this slice
*/
public interface KeysetAwareSlice<T> extends Slice<T> {
Expand Down
2 changes: 1 addition & 1 deletion spec/src/main/asciidoc/repository.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Other types of updates to data, however, will cause duplicate or missed results.

==== Restrictions on use of Keyset Pagination

* The repository method signature must return `KeysetAwareSlice` or `KeysetAwarePage`.
* The repository method signature must return `KeysetAwareSlice` or `KeysetAwarePage`. A repository method with return type of `KeysetAwareSlice` or `KeysetAwarePage` must raise `UnsupportedOperationException` if the database is incapable of keyset pagination.
* The repository method signature must accept a `Pageable` parameter.
* Sort criteria must be provided and should be minimal.
* The combination of provided sort criteria must uniquely identify each entity.
Expand Down

0 comments on commit 2603399

Please sign in to comment.