@Override public Object execute(Query query) { GeoResults<Object> geoResults = doExecuteQuery(query); Page<GeoResult<Object>> page = PageableExecutionUtils.getPage(geoResults.getContent(), accessor.getPageable(), () -> { Query countQuery = mongoQuery.createCountQuery(accessor); countQuery = mongoQuery.applyQueryMetaAttributesWhenPresent(countQuery); return operation.matching(countQuery).count(); }); // transform to GeoPage after applying optimization return new GeoPage<>(geoResults, accessor.getPageable(), page.getTotalElements()); } }
@Override public Object execute(Query query) { GeoResults<Object> geoResults = doExecuteQuery(query); Page<GeoResult<Object>> page = PageableExecutionUtils.getPage(geoResults.getContent(), accessor.getPageable(), () -> { Query countQuery = mongoQuery.createCountQuery(accessor); countQuery = mongoQuery.applyQueryMetaAttributesWhenPresent(countQuery); return operation.matching(countQuery).count(); }); // transform to GeoPage after applying optimization return new GeoPage<>(geoResults, accessor.getPageable(), page.getTotalElements()); } }
@Override protected GeoPage doAdapt(Invocation invocation, Iterable iterable) { final List content = new ArrayList(); for (Object item : iterable) { //noinspection unchecked content.add(item); } //noinspection unchecked return new GeoPage(new GeoResults(content)); }
@Override protected GeoPage doAdapt(Invocation invocation, Iterable iterable) { final List content = new ArrayList(); for (Object item : iterable) { //noinspection unchecked content.add(item); } //noinspection unchecked return new GeoPage(new GeoResults(content)); }
@Override public Slice adapt(Invocation invocation, Object originalValue) { //noinspection unchecked return new GeoPage(new GeoResults(Collections.<GeoResult>emptyList())); }
@Override public Slice adapt(Invocation invocation, Object originalValue) { //noinspection unchecked return new GeoPage(new GeoResults(Collections.<GeoResult>emptyList())); }
public GeoPage<?> convertGeoPage() { Assert.notNull(result.getStats().getFullCount(), MISSING_FULL_COUNT); return new GeoPage<>(buildGeoResults(result), accessor.getPageable(), result.getStats().getFullCount()); }
public GeoPage<?> convertGeoPage() { Assert.notNull(result.getStats().getFullCount(), MISSING_FULL_COUNT); return new GeoPage<>(buildGeoResults(result), accessor.getPageable(), result.getStats().getFullCount()); }