Class KeyValuePartTreeQuery
java.lang.Object
org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery
- All Implemented Interfaces:
RepositoryQuery
- Direct Known Subclasses:
CachingKeyValuePartTreeQuery
RepositoryQuery
implementation deriving queries from PartTree
using a predefined
AbstractQueryCreator
.- Author:
- Christoph Strobl, Oliver Gierke, Mark Paluch
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
KeyValuePartTreeQuery.QueryCreatorFactory<T extends AbstractQueryCreator<?,
?>> Factory class for obtainingAbstractQueryCreator
instances for a givenPartTree
andParameterAccessor
. -
Constructor Summary
ConstructorDescriptionKeyValuePartTreeQuery
(QueryMethod queryMethod, QueryMethodEvaluationContextProvider evaluationContextProvider, KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) Creates a newKeyValuePartTreeQuery
for the givenQueryMethod
,EvaluationContextProvider
,KeyValueOperations
and query creator type.KeyValuePartTreeQuery
(QueryMethod queryMethod, QueryMethodEvaluationContextProvider evaluationContextProvider, KeyValueOperations keyValueOperations, KeyValuePartTreeQuery.QueryCreatorFactory<AbstractQueryCreator<KeyValueQuery<?>, ?>> queryCreatorFactory) Creates a newKeyValuePartTreeQuery
for the givenQueryMethod
,EvaluationContextProvider
,KeyValueOperations
using the givenKeyValuePartTreeQuery.QueryCreatorFactory
producing theAbstractQueryCreator
in charge of altering the query. -
Method Summary
Modifier and TypeMethodDescriptioncreateQuery
(ParameterAccessor accessor) Create aKeyValueQuery
givenParameterAccessor
.protected Object
doExecute
(Object[] parameters, KeyValueQuery<?> query) protected KeyValueQuery<?>
prepareQuery
(Object[] parameters) protected KeyValueQuery<?>
prepareQuery
(KeyValueQuery<?> instance, Object[] parameters)
-
Constructor Details
-
KeyValuePartTreeQuery
public KeyValuePartTreeQuery(QueryMethod queryMethod, QueryMethodEvaluationContextProvider evaluationContextProvider, KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) Creates a newKeyValuePartTreeQuery
for the givenQueryMethod
,EvaluationContextProvider
,KeyValueOperations
and query creator type.- Parameters:
queryMethod
- must not be null.evaluationContextProvider
- must not be null.keyValueOperations
- must not be null.queryCreator
- must not be null.
-
KeyValuePartTreeQuery
public KeyValuePartTreeQuery(QueryMethod queryMethod, QueryMethodEvaluationContextProvider evaluationContextProvider, KeyValueOperations keyValueOperations, KeyValuePartTreeQuery.QueryCreatorFactory<AbstractQueryCreator<KeyValueQuery<?>, ?>> queryCreatorFactory) Creates a newKeyValuePartTreeQuery
for the givenQueryMethod
,EvaluationContextProvider
,KeyValueOperations
using the givenKeyValuePartTreeQuery.QueryCreatorFactory
producing theAbstractQueryCreator
in charge of altering the query.- Parameters:
queryMethod
- must not be null.evaluationContextProvider
- must not be null.keyValueOperations
- must not be null.queryCreatorFactory
- must not be null.- Since:
- 2.0
-
-
Method Details
-
execute
- Specified by:
execute
in interfaceRepositoryQuery
-
doExecute
- Parameters:
parameters
-query
-
-
prepareQuery
-
prepareQuery
-
createQuery
Create aKeyValueQuery
givenParameterAccessor
.- Parameters:
accessor
- must not be null.- Returns:
- the
KeyValueQuery
.
-
getQueryMethod
- Specified by:
getQueryMethod
in interfaceRepositoryQuery
-