public abstract class AbstractReactiveMongoQuery extends Object implements org.springframework.data.repository.query.RepositoryQuery
RepositoryQuery
implementations for MongoDB.Constructor and Description |
---|
AbstractReactiveMongoQuery(ReactiveMongoQueryMethod method,
ReactiveMongoOperations operations,
ExpressionParser expressionParser,
org.springframework.data.repository.query.ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider)
|
Modifier and Type | Method and Description |
---|---|
protected reactor.core.publisher.Mono<Query> |
createCountQuery(ConvertingParameterAccessor accessor)
Creates a
Query instance using the given ConvertingParameterAccessor . |
protected abstract reactor.core.publisher.Mono<Query> |
createQuery(ConvertingParameterAccessor accessor)
Creates a
Query instance using the given ParameterAccessor |
protected reactor.core.publisher.Mono<UpdateDefinition> |
createUpdate(MongoParameterAccessor accessor)
|
protected org.reactivestreams.Publisher<Object> |
doExecute(ReactiveMongoQueryMethod method,
org.springframework.data.repository.query.ResultProcessor processor,
ConvertingParameterAccessor accessor,
Class<?> typeToRead)
Execute the
RepositoryQuery of the given method with the parameters provided by the
accessor |
org.reactivestreams.Publisher<Object> |
execute(Object[] parameters) |
protected reactor.core.publisher.Mono<org.bson.codecs.configuration.CodecRegistry> |
getCodecRegistry() |
protected reactor.core.publisher.Mono<ParameterBindingDocumentCodec> |
getParameterBindingCodec()
Obtain the
ParameterBindingDocumentCodec used for parsing JSON expressions. |
MongoQueryMethod |
getQueryMethod() |
protected reactor.core.publisher.Mono<org.springframework.data.mapping.model.SpELExpressionEvaluator> |
getSpelEvaluatorFor(org.springframework.data.spel.ExpressionDependencies dependencies,
ConvertingParameterAccessor accessor)
Deprecated.
|
protected reactor.core.publisher.Mono<org.springframework.data.mapping.model.SpELExpressionEvaluator> |
getSpelEvaluatorFor(org.springframework.data.spel.ExpressionDependencies dependencies,
MongoParameterAccessor accessor)
Obtain a
publisher emitting the SpELExpressionEvaluator suitable to evaluate expressions
backed by the given dependencies. |
protected abstract boolean |
isCountQuery()
Returns whether the query should get a count projection applied.
|
protected abstract boolean |
isDeleteQuery()
Return weather the query should delete matching documents.
|
protected abstract boolean |
isExistsQuery()
Returns whether the query should get an exists projection applied.
|
protected abstract boolean |
isLimiting()
Return whether the query has an explicit limit set.
|
protected reactor.core.publisher.Mono<List<AggregationOperation>> |
parseAggregationPipeline(String[] pipeline,
MongoParameterAccessor accessor)
Parse the given aggregation pipeline stages applying values to placeholders to compute the actual list of
operations . |
public AbstractReactiveMongoQuery(ReactiveMongoQueryMethod method, ReactiveMongoOperations operations, ExpressionParser expressionParser, org.springframework.data.repository.query.ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider)
method
- must not be null.operations
- must not be null.expressionParser
- must not be null.evaluationContextProvider
- must not be null.public MongoQueryMethod getQueryMethod()
getQueryMethod
in interface org.springframework.data.repository.query.RepositoryQuery
public org.reactivestreams.Publisher<Object> execute(Object[] parameters)
execute
in interface org.springframework.data.repository.query.RepositoryQuery
protected org.reactivestreams.Publisher<Object> doExecute(ReactiveMongoQueryMethod method, org.springframework.data.repository.query.ResultProcessor processor, ConvertingParameterAccessor accessor, @Nullable Class<?> typeToRead)
RepositoryQuery
of the given method with the parameters provided by the
accessor
method
- the ReactiveMongoQueryMethod
invoked. Never null.processor
- ResultProcessor
for post procession. Never null.accessor
- for providing invocation arguments. Never null.typeToRead
- the desired component target type. Can be null.protected reactor.core.publisher.Mono<Query> createCountQuery(ConvertingParameterAccessor accessor)
Query
instance using the given ConvertingParameterAccessor
. Will delegate to
createQuery(ConvertingParameterAccessor)
by default but allows customization of the count query to be
triggered.accessor
- must not be null.protected reactor.core.publisher.Mono<UpdateDefinition> createUpdate(MongoParameterAccessor accessor)
update
from the given
accessor
or creates
one via by parsing the annotated statement extracted from Update
.accessor
- never null.UpdateDefinition
.IllegalStateException
- if no update could be found.protected reactor.core.publisher.Mono<List<AggregationOperation>> parseAggregationPipeline(String[] pipeline, MongoParameterAccessor accessor)
operations
.pipeline
- must not be null.accessor
- must not be null.protected reactor.core.publisher.Mono<ParameterBindingDocumentCodec> getParameterBindingCodec()
ParameterBindingDocumentCodec
used for parsing JSON expressions.@Deprecated protected reactor.core.publisher.Mono<org.springframework.data.mapping.model.SpELExpressionEvaluator> getSpelEvaluatorFor(org.springframework.data.spel.ExpressionDependencies dependencies, ConvertingParameterAccessor accessor)
getSpelEvaluatorFor(ExpressionDependencies, MongoParameterAccessor)
publisher
emitting the SpELExpressionEvaluator
suitable to evaluate expressions
backed by the given dependencies.dependencies
- must not be null.accessor
- must not be null.Mono
emitting the SpELExpressionEvaluator
when ready.protected reactor.core.publisher.Mono<org.springframework.data.mapping.model.SpELExpressionEvaluator> getSpelEvaluatorFor(org.springframework.data.spel.ExpressionDependencies dependencies, MongoParameterAccessor accessor)
publisher
emitting the SpELExpressionEvaluator
suitable to evaluate expressions
backed by the given dependencies.dependencies
- must not be null.accessor
- must not be null.Mono
emitting the SpELExpressionEvaluator
when ready.protected reactor.core.publisher.Mono<org.bson.codecs.configuration.CodecRegistry> getCodecRegistry()
Mono
emitting the CodecRegistry
when ready.protected abstract reactor.core.publisher.Mono<Query> createQuery(ConvertingParameterAccessor accessor)
Query
instance using the given ParameterAccessor
accessor
- must not be null.protected abstract boolean isCountQuery()
protected abstract boolean isExistsQuery()
protected abstract boolean isDeleteQuery()
protected abstract boolean isLimiting()
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.