@@ -102,7 +102,11 @@ class FetchableFluentQueryByExample<S, R> extends FluentQuerySupport<S, R> {
|
||||
|
||||
if (scrollPosition instanceof OffsetScrollPosition osp) {
|
||||
|
||||
Query query = createQuery().sort(getSort()).offset(osp.getOffset());
|
||||
Query query = createQuery().sort(getSort());
|
||||
|
||||
if (!osp.isInitial()) {
|
||||
query = query.offset(osp.getOffset() + 1);
|
||||
}
|
||||
|
||||
if (getLimit() > 0) {
|
||||
query = query.limit(getLimit());
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ScrollDelegate {
|
||||
List<T> result = queryFunction.apply(query);
|
||||
|
||||
if (scrollPosition instanceof OffsetScrollPosition offset) {
|
||||
return createWindow(result, limit, OffsetScrollPosition.positionFunction(offset.getOffset()));
|
||||
return createWindow(result, limit, offset.positionFunction());
|
||||
}
|
||||
|
||||
throw new UnsupportedOperationException("ScrollPosition " + scrollPosition + " not supported");
|
||||
|
||||
Reference in New Issue
Block a user