Closed rstoyanchev closed 3 months ago
@rstoyanchev my understanding of what we need has increased since you've closed the other issue.
Taking into account that you will be dealing with pagination; I would (re)ask: Can we have the total element/count information on Connection?
After looking into the pagination package I can now see I would need to reimplement a lot to provide a total count on a new type of connection that supports pagination...
Could we introduce some other ConnectionAdapterSupport for org.springframework.data.domain.Page
type?
I see we have SliceConnectionAdapter and WindowConnectionAdapter... Perhaps we could have a PageConnectionAdapter.
We could reuse/compose with SliceConnectionAdapter since it already provides most of what we need, other than the totalCount which is provided by the Page ( Slice subclass )
Sorry for hijacking this issue but seems related to the work you will be doing.
Edit:
We would probably need:
Optional<Integer> getTotalCount(Object container);
at ConnectionAdapter interface as well.
The steps to check have been updated to start by looking for either "after" or "first", leading to forward pagination. Then for the presence of either "before" or "last" for backward pagination.
While investigating #925, I noticed we only check for the presence of
last
to assume backward pagination, so for a query with onlybefore
, we assume forward, and as a result ignore thebefore
argument. The pagination spec does expect bothlast
andbefore
to enable backward pagination, but nevertheless we should check the presence of eitherlast
orbefore