/** * Returns whether the query is a geo near query. * * @return */ public boolean isGeoNearQuery() { return isGeoNearQuery(this.method); }
@Override protected MongoParameters createParameters(Method method) { return new MongoParameters(method, isGeoNearQuery(method)); }
/** * Creates a new {@link PartTreeMongoQuery} from the given {@link QueryMethod} and {@link MongoTemplate}. * * @param method must not be {@literal null}. * @param mongoOperations must not be {@literal null}. */ public PartTreeMongoQuery(MongoQueryMethod method, MongoOperations mongoOperations) { super(method, mongoOperations); this.processor = method.getResultProcessor(); this.tree = new PartTree(method.getName(), processor.getReturnedType().getDomainType()); this.isGeoNearQuery = method.isGeoNearQuery(); this.context = mongoOperations.getConverter().getMappingContext(); }
/** * Returns whether the query is a geo near query. * * @return */ public boolean isGeoNearQuery() { return isGeoNearQuery(this.method); }
@Override protected MongoParameters createParameters(Method method) { return new MongoParameters(method, isGeoNearQuery(method)); }
private MongoQueryExecution getExecution(ConvertingParameterAccessor accessor, FindWithQuery<?> operation) { if (isDeleteQuery()) { return new DeleteExecution(operations, method); } else if (method.isGeoNearQuery() && method.isPageQuery()) { return new PagingGeoNearExecution(operation, method, accessor, this); } else if (method.isGeoNearQuery()) { return new GeoNearExecution(operation, method, accessor); } else if (method.isSliceQuery()) { return new SlicedExecution(operation, accessor.getPageable()); } else if (method.isStreamQuery()) { return q -> operation.matching(q).stream(); } else if (method.isCollectionQuery()) { return q -> operation.matching(q.with(accessor.getPageable()).with(accessor.getSort())).all(); } else if (method.isPageQuery()) { return new PagedExecution(operation, accessor.getPageable()); } else if (isCountQuery()) { return q -> operation.matching(q).count(); } else if (isExistsQuery()) { return q -> operation.matching(q).exists(); } else { return q -> { TerminatingFind<?> find = operation.matching(q); return isLimiting() ? find.firstValue() : find.oneValue(); }; } }
/** * Creates a new {@link PartTreeMongoQuery} from the given {@link QueryMethod} and {@link MongoTemplate}. * * @param method must not be {@literal null}. * @param mongoOperations must not be {@literal null}. */ public PartTreeMongoQuery(MongoQueryMethod method, MongoOperations mongoOperations) { super(method, mongoOperations); this.processor = method.getResultProcessor(); this.tree = new PartTree(method.getName(), processor.getReturnedType().getDomainType()); this.isGeoNearQuery = method.isGeoNearQuery(); this.context = mongoOperations.getConverter().getMappingContext(); }
private MongoQueryExecution getExecution(ConvertingParameterAccessor accessor, FindWithQuery<?> operation) { if (isDeleteQuery()) { return new DeleteExecution(operations, method); } else if (method.isGeoNearQuery() && method.isPageQuery()) { return new PagingGeoNearExecution(operation, method, accessor, this); } else if (method.isGeoNearQuery()) { return new GeoNearExecution(operation, method, accessor); } else if (method.isSliceQuery()) { return new SlicedExecution(operation, accessor.getPageable()); } else if (method.isStreamQuery()) { return q -> operation.matching(q).stream(); } else if (method.isCollectionQuery()) { return q -> operation.matching(q.with(accessor.getPageable()).with(accessor.getSort())).all(); } else if (method.isPageQuery()) { return new PagedExecution(operation, accessor.getPageable()); } else if (isCountQuery()) { return q -> operation.matching(q).count(); } else if (isExistsQuery()) { return q -> operation.matching(q).exists(); } else { return q -> { TerminatingFind<?> find = operation.matching(q); return isLimiting() ? find.firstValue() : find.oneValue(); }; } }