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, EnvironmentAware, 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
-
Nested Class Summary
Nested classes/interfaces inherited from class RepositoryFactoryBeanSupport
RepositoryFactoryBeanSupport.FragmentCreationContext, RepositoryFactoryBeanSupport.RepositoryFragmentsFunction -
Field Summary
Fields inherited from interface 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 RepositoryFactoryBeanSupport
addRepositoryFactoryCustomizer, createDefaultEvaluationContextProvider, getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryFragmentsContributor, getRepositoryInformation, setApplicationEventPublisher, setBeanClassLoader, setBeanFactory, setCustomImplementation, setEnvironment, setEvaluationContextProvider, setExposeMetadata, setLazyInit, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments, setRepositoryFragmentsFunctionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FactoryBean
isSingleton
-
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>
-