DATACMNS-842 - Projections on repository methods support Slices now.

ResultProcessor now checks for Slice instead of Page as the projection applying method map(…) is available on Slice as well.
This commit is contained in:
Oliver Gierke
2016-04-09 14:09:40 +02:00
parent 3ff31e5f89
commit f6c876b9bd
2 changed files with 24 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ import java.util.Map;
import org.springframework.core.CollectionFactory;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Slice;
import org.springframework.data.projection.ProjectionFactory;
import org.springframework.util.Assert;
@@ -129,8 +129,8 @@ public class ResultProcessor {
ChainingConverter converter = ChainingConverter.of(type.getReturnedType(), preparingConverter).and(this.converter);
if (source instanceof Page && method.isPageQuery()) {
return (T) ((Page<?>) source).map(converter);
if (source instanceof Slice && method.isPageQuery() || method.isSliceQuery()) {
return (T) ((Slice<?>) source).map(converter);
}
if (source instanceof Collection && method.isCollectionQuery()) {