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 newKeyValueRepositoryFactoryBeanfor the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected final RepositoryFactorySupportprotected KeyValueRepositoryFactorycreateRepositoryFactory(KeyValueOperations operations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) Create the repository factory to be used to create repositories.voidsetKeyValueOperations(KeyValueOperations operations) Configures theKeyValueOperationsto be used for the repositories.voidsetMappingContext(MappingContext<?, ?> mappingContext) voidsetQueryCreator(Class<? extends AbstractQueryCreator<?, ?>> queryCreator) Configures theQueryCreatorTypeto be used.voidsetQueryType(Class<? extends RepositoryQuery> repositoryQueryType) Configures theRepositoryQuerytype 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 newKeyValueRepositoryFactoryBeanfor the given repository interface.- Parameters:
repositoryInterface- must not be null.
-
-
Method Details
-
setKeyValueOperations
Configures theKeyValueOperationsto be used for the repositories.- Parameters:
operations- must not be null.
-
setMappingContext
- Overrides:
setMappingContextin classRepositoryFactoryBeanSupport<T extends Repository<S,ID>, S, ID>
-
setQueryCreator
Configures theQueryCreatorTypeto be used.- Parameters:
queryCreator- must not be null.
-
setQueryType
Configures theRepositoryQuerytype to be created.- Parameters:
repositoryQueryType- must not be null.- Since:
- 1.1
-
createRepositoryFactory
- Specified by:
createRepositoryFactoryin 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:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classRepositoryFactoryBeanSupport<T extends Repository<S,ID>, S, ID>
-