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
ConstructorsConstructorDescriptionStringBasedMongoQuery(String query, MongoQueryMethod method, MongoOperations mongoOperations, ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQueryfor the givenString,MongoQueryMethod,MongoOperations,SpelExpressionParserandQueryMethodEvaluationContextProvider.StringBasedMongoQuery(MongoQueryMethod method, MongoOperations mongoOperations, ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQueryfor the givenMongoQueryMethod,MongoOperations,SpelExpressionParserandQueryMethodEvaluationContextProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected QuerycreateQuery(ConvertingParameterAccessor accessor) Creates aQueryinstance using the givenParameterAccessorprotected booleanReturns whether the query should get a count projection applied.protected booleanReturn weather the query should delete matching documents.protected booleanReturns whether the query should get an exists projection applied.protected booleanReturn 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, ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQueryfor the givenMongoQueryMethod,MongoOperations,SpelExpressionParserandQueryMethodEvaluationContextProvider.- 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, ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedMongoQueryfor the givenString,MongoQueryMethod,MongoOperations,SpelExpressionParserandQueryMethodEvaluationContextProvider.- 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:AbstractMongoQueryCreates aQueryinstance using the givenParameterAccessor- Specified by:
createQueryin classAbstractMongoQuery- Parameters:
accessor- must not be null.- Returns:
-
isCountQuery
protected boolean isCountQuery()Description copied from class:AbstractMongoQueryReturns whether the query should get a count projection applied.- Specified by:
isCountQueryin classAbstractMongoQuery- Returns:
-
isExistsQuery
protected boolean isExistsQuery()Description copied from class:AbstractMongoQueryReturns whether the query should get an exists projection applied.- Specified by:
isExistsQueryin classAbstractMongoQuery- Returns:
-
isDeleteQuery
protected boolean isDeleteQuery()Description copied from class:AbstractMongoQueryReturn weather the query should delete matching documents.- Specified by:
isDeleteQueryin classAbstractMongoQuery- Returns:
-
isLimiting
protected boolean isLimiting()Description copied from class:AbstractMongoQueryReturn whether the query has an explicit limit set.- Specified by:
isLimitingin classAbstractMongoQuery- Returns:
-