Class KeyValueRepositoryFactory

java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactorySupport
org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactory
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware

public class KeyValueRepositoryFactory extends org.springframework.data.repository.core.support.RepositoryFactorySupport
RepositoryFactorySupport specific of handing KeyValueRepository.
Author:
Christoph Strobl, Oliver Gierke, Mark Paluch
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new KeyValueRepositoryFactory for the given KeyValueOperations.
    KeyValueRepositoryFactory(KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?,?>> queryCreator)
    Creates a new KeyValueRepositoryFactory for the given KeyValueOperations and AbstractQueryCreator-type.
    KeyValueRepositoryFactory(KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?,?>> queryCreator, Class<? extends org.springframework.data.repository.query.RepositoryQuery> repositoryQueryType)
    Creates a new KeyValueRepositoryFactory for the given KeyValueOperations and AbstractQueryCreator-type.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, ID> org.springframework.data.repository.core.EntityInformation<T,ID>
    getEntityInformation(Class<T> domainClass)
     
    protected Optional<org.springframework.data.repository.query.QueryLookupStrategy>
    getQueryLookupStrategy(org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider)
     
    protected Class<?>
    getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata)
     
    protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments
    getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata)
     
    protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments
    getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata, KeyValueOperations operations)
    Creates RepositoryComposition.RepositoryFragments based on RepositoryMetadata to add Key-Value-specific extensions.
    protected Object
    getTargetRepository(org.springframework.data.repository.core.RepositoryInformation repositoryInformation)
     

    Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactorySupport

    addInvocationListener, addQueryCreationListener, addRepositoryProxyPostProcessor, getProjectionFactory, getProjectionFactory, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, instantiateClass, setBeanClassLoader, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KeyValueRepositoryFactory

      public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations)
      Creates a new KeyValueRepositoryFactory for the given KeyValueOperations.
      Parameters:
      keyValueOperations - must not be null.
    • KeyValueRepositoryFactory

      public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?,?>> queryCreator)
      Creates a new KeyValueRepositoryFactory for the given KeyValueOperations and AbstractQueryCreator-type.
      Parameters:
      keyValueOperations - must not be null.
      queryCreator - must not be null.
    • KeyValueRepositoryFactory

      public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?,?>> queryCreator, Class<? extends org.springframework.data.repository.query.RepositoryQuery> repositoryQueryType)
      Creates a new KeyValueRepositoryFactory for the given KeyValueOperations and AbstractQueryCreator-type.
      Parameters:
      keyValueOperations - must not be null.
      queryCreator - must not be null.
      repositoryQueryType - must not be null.
      Since:
      1.1
  • Method Details

    • getEntityInformation

      public <T, ID> org.springframework.data.repository.core.EntityInformation<T,ID> getEntityInformation(Class<T> domainClass)
      Specified by:
      getEntityInformation in class org.springframework.data.repository.core.support.RepositoryFactorySupport
    • getTargetRepository

      protected Object getTargetRepository(org.springframework.data.repository.core.RepositoryInformation repositoryInformation)
      Specified by:
      getTargetRepository in class org.springframework.data.repository.core.support.RepositoryFactorySupport
    • getRepositoryBaseClass

      protected Class<?> getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata)
      Specified by:
      getRepositoryBaseClass in class org.springframework.data.repository.core.support.RepositoryFactorySupport
    • getRepositoryFragments

      protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata)
      Overrides:
      getRepositoryFragments in class org.springframework.data.repository.core.support.RepositoryFactorySupport
    • getRepositoryFragments

      protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata, KeyValueOperations operations)
      Creates RepositoryComposition.RepositoryFragments based on RepositoryMetadata to add Key-Value-specific extensions. Typically adds a QuerydslKeyValuePredicateExecutor if the repository interface uses Querydsl.

      Can be overridden by subclasses to customize RepositoryComposition.RepositoryFragments.

      Parameters:
      metadata - repository metadata.
      operations - the KeyValue operations manager.
      Returns:
      Since:
      2.6
    • getQueryLookupStrategy

      protected Optional<org.springframework.data.repository.query.QueryLookupStrategy> getQueryLookupStrategy(@Nullable org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider)
      Overrides:
      getQueryLookupStrategy in class org.springframework.data.repository.core.support.RepositoryFactorySupport