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 newR2dbcRepositoryFactoryBean
for the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Optional<org.springframework.data.repository.query.QueryMethodEvaluationContextProvider>
createDefaultQueryMethodEvaluationContextProvider
(org.springframework.beans.factory.ListableBeanFactory beanFactory) protected final org.springframework.data.repository.core.support.RepositoryFactorySupport
protected org.springframework.data.repository.core.support.RepositoryFactorySupport
getFactoryInstance
(R2dbcEntityOperations operations) Creates and initializes aRepositoryFactorySupport
instance.protected org.springframework.data.repository.core.support.RepositoryFactorySupport
getFactoryInstance
(org.springframework.r2dbc.core.DatabaseClient client, ReactiveDataAccessStrategy dataAccessStrategy) Creates and initializes aRepositoryFactorySupport
instance.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setDataAccessStrategy
(ReactiveDataAccessStrategy dataAccessStrategy) void
setDatabaseClient
(org.springframework.r2dbc.core.DatabaseClient client) Configures theDatabaseClient
to be used.void
setEntityOperations
(R2dbcEntityOperations operations) protected void
setMappingContext
(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 newR2dbcRepositoryFactoryBean
for the given repository interface.- Parameters:
repositoryInterface
- must not be null.
-
-
Method Details
-
setDatabaseClient
public void setDatabaseClient(org.springframework.r2dbc.core.DatabaseClient client) Configures theDatabaseClient
to 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 aRepositoryFactorySupport
instance.- 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 aRepositoryFactorySupport
instance.- 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,
ID>, S, ID extends Serializable>
-