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
ConstructorsConstructorDescriptionKeyValueRepositoryFactory(KeyValueOperations keyValueOperations) Creates a newKeyValueRepositoryFactoryfor the givenKeyValueOperations.KeyValueRepositoryFactory(KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?, ?>> queryCreator) Creates a newKeyValueRepositoryFactoryfor the givenKeyValueOperationsandAbstractQueryCreator-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 newKeyValueRepositoryFactoryfor the givenKeyValueOperationsandAbstractQueryCreator-type. -
Method Summary
Modifier and TypeMethodDescription<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.RepositoryFragmentsgetRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata) protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragmentsgetRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata, KeyValueOperations operations) CreatesRepositoryComposition.RepositoryFragmentsbased onRepositoryMetadatato add Key-Value-specific extensions.protected ObjectgetTargetRepository(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
-
Constructor Details
-
KeyValueRepositoryFactory
Creates a newKeyValueRepositoryFactoryfor the givenKeyValueOperations.- Parameters:
keyValueOperations- must not be null.
-
KeyValueRepositoryFactory
public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations, Class<? extends org.springframework.data.repository.query.parser.AbstractQueryCreator<?, ?>> queryCreator) Creates a newKeyValueRepositoryFactoryfor the givenKeyValueOperationsandAbstractQueryCreator-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 newKeyValueRepositoryFactoryfor the givenKeyValueOperationsandAbstractQueryCreator-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:
getEntityInformationin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getTargetRepository
protected Object getTargetRepository(org.springframework.data.repository.core.RepositoryInformation repositoryInformation) - Specified by:
getTargetRepositoryin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getRepositoryBaseClass
protected Class<?> getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata) - Specified by:
getRepositoryBaseClassin classorg.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:
getRepositoryFragmentsin classorg.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) CreatesRepositoryComposition.RepositoryFragmentsbased onRepositoryMetadatato add Key-Value-specific extensions. Typically adds aQuerydslKeyValuePredicateExecutorif 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:
getQueryLookupStrategyin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-