Module spring.data.r2dbc
Class R2dbcRepositoryFactoryBean<T extends Repository<S,ID>,S,ID extends Serializable>
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
org.springframework.data.r2dbc.repository.support.R2dbcRepositoryFactoryBean<T,S,ID>
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,FactoryBean<T>,InitializingBean,ApplicationContextAware,ApplicationEventPublisherAware,RepositoryFactoryInformation<S,ID>
public class R2dbcRepositoryFactoryBean<T extends Repository<S,ID>,S,ID extends Serializable>
extends RepositoryFactoryBeanSupport<T,S,ID>
implements ApplicationContextAware
FactoryBean to create
R2dbcRepository instances. Can be either configured with
R2dbcEntityOperations or DatabaseClient with ReactiveDataAccessStrategy.- Author:
- Mark Paluch, Christoph Strobl
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionR2dbcRepositoryFactoryBean(Class<? extends T> repositoryInterface) Creates a newR2dbcRepositoryFactoryBeanfor the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected Optional<QueryMethodEvaluationContextProvider>protected final RepositoryFactorySupportprotected RepositoryFactorySupportgetFactoryInstance(R2dbcEntityOperations operations) Creates and initializes aRepositoryFactorySupportinstance.protected RepositoryFactorySupportgetFactoryInstance(DatabaseClient client, ReactiveDataAccessStrategy dataAccessStrategy) Creates and initializes aRepositoryFactorySupportinstance.voidsetApplicationContext(ApplicationContext applicationContext) voidsetDataAccessStrategy(ReactiveDataAccessStrategy dataAccessStrategy) voidsetDatabaseClient(DatabaseClient client) Configures theDatabaseClientto be used.voidsetEntityOperations(R2dbcEntityOperations operations) protected voidsetMappingContext(MappingContext<?, ?> mappingContext) Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport
addRepositoryFactoryCustomizer, getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryInformation, isSingleton, setApplicationEventPublisher, setBeanClassLoader, setBeanFactory, setCustomImplementation, setEvaluationContextProvider, setLazyInit, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments
-
Constructor Details
-
R2dbcRepositoryFactoryBean
Creates a newR2dbcRepositoryFactoryBeanfor the given repository interface.- Parameters:
repositoryInterface- must not be null.
-
-
Method Details
-
setDatabaseClient
Configures theDatabaseClientto be used.- Parameters:
client- the client to set
-
setDataAccessStrategy
-
setEntityOperations
- Parameters:
operations-- Since:
- 1.1.3
-
setMappingContext
- Overrides:
setMappingContextin classRepositoryFactoryBeanSupport<T extends Repository<S,ID>, S, ID extends Serializable>
-
createRepositoryFactory
- Specified by:
createRepositoryFactoryin classRepositoryFactoryBeanSupport<T extends Repository<S,ID>, S, ID extends Serializable>
-
createDefaultQueryMethodEvaluationContextProvider
protected Optional<QueryMethodEvaluationContextProvider> createDefaultQueryMethodEvaluationContextProvider(ListableBeanFactory beanFactory) - Overrides:
createDefaultQueryMethodEvaluationContextProviderin classRepositoryFactoryBeanSupport<T extends Repository<S,ID>, S, ID extends Serializable>
-
getFactoryInstance
protected RepositoryFactorySupport getFactoryInstance(DatabaseClient client, ReactiveDataAccessStrategy dataAccessStrategy) Creates and initializes aRepositoryFactorySupportinstance.- Parameters:
client- must not be null.dataAccessStrategy- must not be null.- Returns:
- new instance of
RepositoryFactorySupport.
-
getFactoryInstance
Creates and initializes aRepositoryFactorySupportinstance.- Parameters:
operations- must not be null.- Returns:
- new instance of
RepositoryFactorySupport. - Since:
- 1.1.3
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classRepositoryFactoryBeanSupport<T extends Repository<S,ID>, S, ID extends Serializable>
-