@ -7,7 +7,7 @@ You can define simple sorting expressions by using property names and define sta
@@ -7,7 +7,7 @@ You can define simple sorting expressions by using property names and define sta
You can concatenate expressions to collect multiple criteria into one expression.
Scroll queries return a `Window<T>` that allows obtaining the element's scroll position to fetch the next `Window<T>` until your application has consumed the entire query result.
Similar to consuming a Java `Iterator<List<…>>` by obtaining the next batch of results, query result scrolling lets you access the a `ScrollPosition` through `Window.positionAt(...)`.
Similar to consuming a Java `Iterator<List<…>>` by obtaining the next batch of results, query result scrolling lets you access the a `ScrollPosition` through `Window.positionAt(…)`, as in the following example:
@ -38,6 +42,8 @@ In a similar way, providing a `Limit` object allows you to define a dynamic limi
@@ -38,6 +42,8 @@ In a similar way, providing a `Limit` object allows you to define a dynamic limi
Read more on dynamic sorting and limiting in the xref:repositories/query-methods-details.adoc#repositories.special-parameters[Query Methods Details].
====
Scrolling through consuming `Window` instances requires quite a few conditionals to reach optimum database round-trips and can quickly become a repetitive task that can be simplified using `WindowIterator`.
`WindowIterator` provides a utility to simplify scrolling across ``Window``s by removing the need to check for the presence of a next `Window` and applying the `ScrollPosition`.