Class StringBasedMongoQuery
java.lang.Object
org.springframework.data.mongodb.repository.query.AbstractMongoQuery
org.springframework.data.mongodb.repository.query.StringBasedMongoQuery
- All Implemented Interfaces:
org.springframework.data.repository.query.RepositoryQuery
Query to use a plain JSON String to create the
Query
to actually execute.- Author:
- Oliver Gierke, Christoph Strobl, Thomas Darimont, Mark Paluch
-
Constructor Summary
ConstructorDescriptionStringBasedMongoQuery
(String query, MongoQueryMethod method, MongoOperations mongoOperations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQuery
for the givenString
,MongoQueryMethod
,MongoOperations
,SpelExpressionParser
andQueryMethodEvaluationContextProvider
.StringBasedMongoQuery
(MongoQueryMethod method, MongoOperations mongoOperations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQuery
for the givenMongoQueryMethod
,MongoOperations
,SpelExpressionParser
andQueryMethodEvaluationContextProvider
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Query
createQuery
(ConvertingParameterAccessor accessor) Creates aQuery
instance using the givenParameterAccessor
protected boolean
Returns whether the query should get a count projection applied.protected boolean
Return weather the query should delete matching documents.protected boolean
Returns whether the query should get an exists projection applied.protected boolean
Return whether the query has an explicit limit set.Methods inherited from class org.springframework.data.mongodb.repository.query.AbstractMongoQuery
createCountQuery, createUpdate, decode, doExecute, execute, getCodecRegistry, getParameterBindingCodec, getQueryMethod, getSpELExpressionEvaluatorFor, parseAggregationPipeline, prepareBindingContext
-
Constructor Details
-
StringBasedMongoQuery
public StringBasedMongoQuery(MongoQueryMethod method, MongoOperations mongoOperations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQuery
for the givenMongoQueryMethod
,MongoOperations
,SpelExpressionParser
andQueryMethodEvaluationContextProvider
.- Parameters:
method
- must not be null.mongoOperations
- must not be null.expressionParser
- must not be null.evaluationContextProvider
- must not be null.
-
StringBasedMongoQuery
public StringBasedMongoQuery(String query, MongoQueryMethod method, MongoOperations mongoOperations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQuery
for the givenString
,MongoQueryMethod
,MongoOperations
,SpelExpressionParser
andQueryMethodEvaluationContextProvider
.- Parameters:
query
- must not be null.method
- must not be null.mongoOperations
- must not be null.expressionParser
- must not be null.
-
-
Method Details
-
createQuery
Description copied from class:AbstractMongoQuery
Creates aQuery
instance using the givenParameterAccessor
- Specified by:
createQuery
in classAbstractMongoQuery
- Parameters:
accessor
- must not be null.- Returns:
-
isCountQuery
protected boolean isCountQuery()Description copied from class:AbstractMongoQuery
Returns whether the query should get a count projection applied.- Specified by:
isCountQuery
in classAbstractMongoQuery
- Returns:
-
isExistsQuery
protected boolean isExistsQuery()Description copied from class:AbstractMongoQuery
Returns whether the query should get an exists projection applied.- Specified by:
isExistsQuery
in classAbstractMongoQuery
- Returns:
-
isDeleteQuery
protected boolean isDeleteQuery()Description copied from class:AbstractMongoQuery
Return weather the query should delete matching documents.- Specified by:
isDeleteQuery
in classAbstractMongoQuery
- Returns:
-
isLimiting
protected boolean isLimiting()Description copied from class:AbstractMongoQuery
Return whether the query has an explicit limit set.- Specified by:
isLimiting
in classAbstractMongoQuery
- Returns:
-