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
ConstructorDescriptionR2dbcRepositoryFactoryBean
(Class<? extends T> repositoryInterface) Creates a newR2dbcRepositoryFactoryBean
for the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Optional<QueryMethodEvaluationContextProvider>
protected final RepositoryFactorySupport
protected RepositoryFactorySupport
getFactoryInstance
(R2dbcEntityOperations operations) Creates and initializes aRepositoryFactorySupport
instance.protected RepositoryFactorySupport
getFactoryInstance
(DatabaseClient client, ReactiveDataAccessStrategy dataAccessStrategy) Creates and initializes aRepositoryFactorySupport
instance.void
setApplicationContext
(ApplicationContext applicationContext) void
setDataAccessStrategy
(ReactiveDataAccessStrategy dataAccessStrategy) void
setDatabaseClient
(DatabaseClient client) Configures theDatabaseClient
to be used.void
setEntityOperations
(R2dbcEntityOperations operations) protected void
setMappingContext
(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
Configures theDatabaseClient
to be used.- Parameters:
client
- the client to set
-
setDataAccessStrategy
-
setEntityOperations
- Parameters:
operations
-- Since:
- 1.1.3
-
setMappingContext
- Overrides:
setMappingContext
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-
createRepositoryFactory
- Specified by:
createRepositoryFactory
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-
createDefaultQueryMethodEvaluationContextProvider
protected Optional<QueryMethodEvaluationContextProvider> createDefaultQueryMethodEvaluationContextProvider(ListableBeanFactory beanFactory) - Overrides:
createDefaultQueryMethodEvaluationContextProvider
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-
getFactoryInstance
protected RepositoryFactorySupport getFactoryInstance(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
Creates and initializes aRepositoryFactorySupport
instance.- Parameters:
operations
- must not be null.- Returns:
- new instance of
RepositoryFactorySupport
. - Since:
- 1.1.3
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-