Class KeyValueRepositoryFactoryBean<T extends Repository<S,ID>,S,ID>
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactoryBean<T,S,ID>
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,FactoryBean<T>
,InitializingBean
,ApplicationEventPublisherAware
,RepositoryFactoryInformation<S,
ID>
public class KeyValueRepositoryFactoryBean<T extends Repository<S,ID>,S,ID>
extends RepositoryFactoryBeanSupport<T,S,ID>
FactoryBean
to create KeyValueRepository
.- Author:
- Christoph Strobl, Oliver Gierke, Mark Paluch
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
ConstructorsConstructorDescriptionKeyValueRepositoryFactoryBean
(Class<? extends T> repositoryInterface) Creates a newKeyValueRepositoryFactoryBean
for the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected final RepositoryFactorySupport
protected KeyValueRepositoryFactory
createRepositoryFactory
(KeyValueOperations operations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) Create the repository factory to be used to create repositories.void
setKeyValueOperations
(KeyValueOperations operations) Configures theKeyValueOperations
to be used for the repositories.void
setMappingContext
(MappingContext<?, ?> mappingContext) void
setQueryCreator
(Class<? extends AbstractQueryCreator<?, ?>> queryCreator) Configures theQueryCreatorType
to be used.void
setQueryType
(Class<? extends RepositoryQuery> repositoryQueryType) Configures theRepositoryQuery
type to be created.Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport
addRepositoryFactoryCustomizer, createDefaultQueryMethodEvaluationContextProvider, getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryInformation, isSingleton, setApplicationEventPublisher, setBeanClassLoader, setBeanFactory, setCustomImplementation, setEvaluationContextProvider, setLazyInit, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments
-
Constructor Details
-
KeyValueRepositoryFactoryBean
Creates a newKeyValueRepositoryFactoryBean
for the given repository interface.- Parameters:
repositoryInterface
- must not be null.
-
-
Method Details
-
setKeyValueOperations
Configures theKeyValueOperations
to be used for the repositories.- Parameters:
operations
- must not be null.
-
setMappingContext
- Overrides:
setMappingContext
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID>
-
setQueryCreator
Configures theQueryCreatorType
to be used.- Parameters:
queryCreator
- must not be null.
-
setQueryType
Configures theRepositoryQuery
type to be created.- Parameters:
repositoryQueryType
- must not be null.- Since:
- 1.1
-
createRepositoryFactory
- Specified by:
createRepositoryFactory
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID>
-
createRepositoryFactory
protected KeyValueRepositoryFactory createRepositoryFactory(KeyValueOperations operations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) Create the repository factory to be used to create repositories.- Parameters:
operations
- will never be null.queryCreator
- will never be null.repositoryQueryType
- will never be null.- Returns:
- must not be null.
- Since:
- 1.1
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID>
-