Class R2dbcRepositoryFactoryBean<T extends org.springframework.data.repository.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:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.FactoryBean<T>,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationEventPublisherAware,org.springframework.data.repository.core.support.RepositoryFactoryInformation<S,ID>
public class R2dbcRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
extends org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
implements org.springframework.context.ApplicationContextAware
FactoryBean to create
R2dbcRepository instances. Can be either configured with
R2dbcEntityOperations or DatabaseClient with ReactiveDataAccessStrategy.- Author:
- Mark Paluch, Christoph Strobl
- See Also:
-
ReactiveSortingRepository
-
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<org.springframework.data.repository.query.QueryMethodEvaluationContextProvider>createDefaultQueryMethodEvaluationContextProvider(org.springframework.beans.factory.ListableBeanFactory beanFactory) protected final org.springframework.data.repository.core.support.RepositoryFactorySupportprotected org.springframework.data.repository.core.support.RepositoryFactorySupportgetFactoryInstance(R2dbcEntityOperations operations) Creates and initializes aRepositoryFactorySupportinstance.protected org.springframework.data.repository.core.support.RepositoryFactorySupportgetFactoryInstance(org.springframework.r2dbc.core.DatabaseClient client, ReactiveDataAccessStrategy dataAccessStrategy) Creates and initializes aRepositoryFactorySupportinstance.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetDataAccessStrategy(ReactiveDataAccessStrategy dataAccessStrategy) voidsetDatabaseClient(org.springframework.r2dbc.core.DatabaseClient client) Configures theDatabaseClientto be used.voidsetEntityOperations(R2dbcEntityOperations operations) protected voidsetMappingContext(org.springframework.data.mapping.context.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
public void setDatabaseClient(org.springframework.r2dbc.core.DatabaseClient client) Configures theDatabaseClientto be used.- Parameters:
client- the client to set
-
setDataAccessStrategy
-
setEntityOperations
- Parameters:
operations-- Since:
- 1.1.3
-
setMappingContext
protected void setMappingContext(org.springframework.data.mapping.context.MappingContext<?, ?> mappingContext) -
createRepositoryFactory
protected final org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory() -
createDefaultQueryMethodEvaluationContextProvider
protected Optional<org.springframework.data.repository.query.QueryMethodEvaluationContextProvider> createDefaultQueryMethodEvaluationContextProvider(org.springframework.beans.factory.ListableBeanFactory beanFactory) -
getFactoryInstance
protected org.springframework.data.repository.core.support.RepositoryFactorySupport getFactoryInstance(org.springframework.r2dbc.core.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
protected org.springframework.data.repository.core.support.RepositoryFactorySupport getFactoryInstance(R2dbcEntityOperations operations) Creates and initializes aRepositoryFactorySupportinstance.- Parameters:
operations- must not be null.- Returns:
- new instance of
RepositoryFactorySupport. - Since:
- 1.1.3
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>, S, ID extends Serializable>
-