Class KeyValuePartTreeQuery

java.lang.Object
org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery
All Implemented Interfaces:
org.springframework.data.repository.query.RepositoryQuery
Direct Known Subclasses:
CachingKeyValuePartTreeQuery

public class KeyValuePartTreeQuery extends Object implements org.springframework.data.repository.query.RepositoryQuery
RepositoryQuery implementation deriving queries from PartTree using a predefined AbstractQueryCreator.
Author:
Christoph Strobl, Oliver Gierke, Mark Paluch
  • Constructor Details

    • KeyValuePartTreeQuery

      public KeyValuePartTreeQuery(org.springframework.data.repository.query.QueryMethod queryMethod, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider, KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?,?>> queryCreator)
      Creates a new KeyValuePartTreeQuery for the given QueryMethod, 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(org.springframework.data.repository.query.QueryMethod queryMethod, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider, KeyValueOperations keyValueOperations, KeyValuePartTreeQuery.QueryCreatorFactory<org.springframework.data.repository.query.parser.AbstractQueryCreator<KeyValueQuery<?>,?>> queryCreatorFactory)
      Creates a new KeyValuePartTreeQuery for the given QueryMethod, EvaluationContextProvider, KeyValueOperations using the given KeyValuePartTreeQuery.QueryCreatorFactory producing the AbstractQueryCreator 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

      public Object execute(Object[] parameters)
      Specified by:
      execute in interface org.springframework.data.repository.query.RepositoryQuery
    • doExecute

      @Nullable protected Object doExecute(Object[] parameters, KeyValueQuery<?> query)
      Parameters:
      parameters -
      query -
    • prepareQuery

      protected KeyValueQuery<?> prepareQuery(Object[] parameters)
    • prepareQuery

      protected KeyValueQuery<?> prepareQuery(KeyValueQuery<?> instance, Object[] parameters)
    • createQuery

      public KeyValueQuery<?> createQuery(org.springframework.data.repository.query.ParameterAccessor accessor)
      Create a KeyValueQuery given ParameterAccessor.
      Parameters:
      accessor - must not be null.
      Returns:
      the KeyValueQuery.
    • getQueryMethod

      public org.springframework.data.repository.query.QueryMethod getQueryMethod()
      Specified by:
      getQueryMethod in interface org.springframework.data.repository.query.RepositoryQuery