/** * Returns the execution instance to use. * * @param accessor must not be {@literal null}. * @param resultProcessing must not be {@literal null}. * @return */ private ReactiveMongoQueryExecution getExecution(MongoParameterAccessor accessor, Converter<Object, Object> resultProcessing, FindWithQuery<?> operation) { return new ResultProcessingExecution(getExecutionToWrap(accessor, operation), resultProcessing); }
@Override protected MongoParameters createParameters(Method method) { return new MongoParameters(method, isGeoNearQuery(method)); }
public Object execute(Object[] parameters) { return method.hasReactiveWrapperParameter() ? executeDeferred(parameters) : execute(new MongoParametersParameterAccessor(method, parameters)); }
@Override protected Query createQuery(ConvertingParameterAccessor accessor) { String queryString = parameterBinder.bind(this.query, accessor, new BindingContext(getQueryMethod().getParameters(), queryParameterBindings)); String fieldsString = parameterBinder.bind(this.fieldSpec, accessor, new BindingContext(getQueryMethod().getParameters(), fieldSpecParameterBindings)); Query query = new BasicQuery(queryString, fieldsString).with(accessor.getSort()); if (LOG.isDebugEnabled()) { LOG.debug(String.format("Created query %s for %s fields.", query.getQueryObject(), query.getFieldsObject())); } return query; }
@Nullable @Override public TextCriteria getFullText() { int index = method.getParameters().getFullTextParameterIndex(); return index >= 0 ? potentiallyConvertFullText(getValue(index)) : null; }
@Override public Object execute(Query query) { GeoResults<?> results = doExecuteQuery(query); return isListOfGeoResult(method.getReturnType()) ? results.getContent() : results; }
@Override protected MongoParameters createParameters(Method method) { return new MongoParameters(method, isGeoNearQuery(method)); }
public Object getBindableValue(int index) { return getConvertedValue(delegate.getBindableValue(index), null); }
public PotentiallyConvertingIterator iterator() { return new ConvertingIterator(delegate.iterator()); }
/** * Creates a {@link Query} instance using the given {@link ConvertingParameterAccessor}. Will delegate to * {@link #createQuery(ConvertingParameterAccessor)} by default but allows customization of the count query to be * triggered. * * @param accessor must not be {@literal null}. * @return */ protected Query createCountQuery(ConvertingParameterAccessor accessor) { return applyQueryMetaAttributesWhenPresent(createQuery(accessor)); }
/** * Creates a {@link Query} instance using the given {@link ConvertingParameterAccessor}. Will delegate to * {@link #createQuery(ConvertingParameterAccessor)} by default but allows customization of the count query to be * triggered. * * @param accessor must not be {@literal null}. * @return */ protected Query createCountQuery(ConvertingParameterAccessor accessor) { return applyQueryMetaAttributesWhenPresent(createQuery(accessor)); }
/** * Creates new {@link BindingContext}. * * @param parameters * @param bindings */ public BindingContext(MongoParameters parameters, List<ParameterBinding> bindings) { this.parameters = parameters; this.bindings = mapBindings(bindings); }
@Override public String encode(CodecRegistryProvider provider, boolean quoted) { return encodeCollection(provider, this.value, Binary::new, BinaryCodec::new); } }
@Override public Object[] getValues() { Object[] result = new Object[values.length]; for (int i = 0; i < result.length; i++) { result[i] = getValue(i); } return result; }
/** * Returns whether the query is a geo near query. * * @return */ public boolean isGeoNearQuery() { return isGeoNearQuery(this.method); }
/** * @return return true if {@link Meta} annotation is available. * @since 1.6 */ public boolean hasQueryMetaAttributes() { return getMetaAnnotation() != null; }
@Override public Optional<Class<?>> getDynamicProjection() { return delegate.getDynamicProjection(); }
@Override public Object[] getValues() { return delegate.getValues(); }
@Override protected MongoParameter createParameter(MethodParameter parameter) { return new MongoParameter(parameter); }
@Override protected MongoParameters createFrom(List<MongoParameter> parameters) { return new MongoParameters(parameters, this.maxDistanceIndex, this.nearIndex, this.fullTextIndex, this.rangeIndex); }