DATACMNS-387 - Introduce Slice abstraction.

Introduced a Slice interface which is effectively a Page without the total page information. This will allow store modules to implement slice-by-slice access without having to calculate a total number of elements.

Extracted content and Pageable related functionality into a common Chunk class which serves as base class for the two concrete implementations SliceImpl and PageImpl. Deprecated hasNextPage() etc. on Page in favor of the generic hasNext() methods.

QueryMethod now exposes an isSliceQuery() to indicate a query method will need sliced execution.
This commit is contained in:
Oliver Gierke
2014-02-28 14:44:15 +01:00
parent 28dac21931
commit 1805aad718
9 changed files with 549 additions and 221 deletions

View File

@@ -155,11 +155,11 @@ public class PagedResourcesAssembler<T> implements ResourceAssembler<Page<T>, Pa
private <R extends ResourceSupport> PagedResources<R> addPaginationLinks(PagedResources<R> resources, Page<?> page,
String uri) {
if (page.hasNextPage()) {
if (page.hasNext()) {
foo(resources, page.nextPageable(), uri, Link.REL_NEXT);
}
if (page.hasPreviousPage()) {
if (page.hasPrevious()) {
foo(resources, page.previousPageable(), uri, Link.REL_PREVIOUS);
}