Class KeysetScrollDelegate
java.lang.Object
org.springframework.data.jpa.repository.query.KeysetScrollDelegate
Delegate for keyset scrolling.
- Since:
- 3.1
- Author:
- Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAdapter to construct scroll queries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E,P> @Nullable P createPredicate(KeysetScrollPosition keyset, Sort sort, KeysetScrollDelegate.QueryStrategy<E, P> strategy) createSort(Sort sort, JpaEntityInformation<?, ?> entity) static Collection<String> getProjectionInputProperties(JpaEntityInformation<?, ?> entity, Collection<String> projectionProperties, Sort sort) Return a collection of property names required to construct a keyset selection query that include all keyset and identifier properties required to resume keyset scrolling.protected <T> List<T> getResultWindow(List<T> list, int limit) protected SortgetSortOrders(Sort sort) static KeysetScrollDelegateof(ScrollPosition.Direction direction) Factory method to obtain the rightKeysetScrollDelegate.protected <T> List<T> postProcessResults(List<T> result)
-
Constructor Details
-
KeysetScrollDelegate
public KeysetScrollDelegate()
-
-
Method Details
-
of
Factory method to obtain the rightKeysetScrollDelegate.- Parameters:
direction- the direction of scrolling.- Returns:
- a
KeysetScrollDelegatematching the requested direction.
-
getProjectionInputProperties
public static Collection<String> getProjectionInputProperties(JpaEntityInformation<?, ?> entity, Collection<String> projectionProperties, Sort sort) Return a collection of property names required to construct a keyset selection query that include all keyset and identifier properties required to resume keyset scrolling.- Parameters:
entity- the underlying entity.projectionProperties- projection property names.sort- sort properties.- Returns:
- a collection of property names required to construct a keyset selection query
-
createPredicate
public <E,P> @Nullable P createPredicate(KeysetScrollPosition keyset, Sort sort, KeysetScrollDelegate.QueryStrategy<E, P> strategy) -
getSortOrders
-
postProcessResults
-
getResultWindow
-
createSort
-