@Configuration(proxyBeanMethods=false) public abstract class AbstractR2dbcConfiguration extends Object implements ApplicationContextAware
ConnectionFactory,
DatabaseClient,
EnableR2dbcRepositories| Constructor and Description |
|---|
AbstractR2dbcConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
abstract ConnectionFactory |
connectionFactory()
Return a R2DBC
ConnectionFactory. |
DatabaseClient |
databaseClient()
|
protected List<Object> |
getCustomConverters()
Customization hook to return custom converters.
|
R2dbcDialect |
getDialect(ConnectionFactory connectionFactory)
Return a
R2dbcDialect for the given ConnectionFactory. |
protected org.springframework.data.convert.CustomConversions.StoreConversions |
getStoreConversions()
Returns the
R2dbcDialect-specific CustomConversions.StoreConversions. |
MappingR2dbcConverter |
r2dbcConverter(R2dbcMappingContext mappingContext,
R2dbcCustomConversions r2dbcCustomConversions)
Creates a
R2dbcConverter using the configured
r2dbcMappingContext(Optional, R2dbcCustomConversions) R2dbcMappingContext}. |
R2dbcCustomConversions |
r2dbcCustomConversions()
Register custom
Converters in a CustomConversions object if required. |
R2dbcEntityTemplate |
r2dbcEntityTemplate(DatabaseClient databaseClient,
ReactiveDataAccessStrategy dataAccessStrategy)
|
R2dbcMappingContext |
r2dbcMappingContext(Optional<org.springframework.data.relational.core.mapping.NamingStrategy> namingStrategy,
R2dbcCustomConversions r2dbcCustomConversions)
Register a
R2dbcMappingContext and apply an optional NamingStrategy. |
ReactiveDataAccessStrategy |
reactiveDataAccessStrategy(R2dbcConverter converter)
Creates a
ReactiveDataAccessStrategy using the configured
R2dbcConverter. |
void |
setApplicationContext(ApplicationContext applicationContext) |
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic abstract ConnectionFactory connectionFactory()
ConnectionFactory. Annotate with Bean in case you want to expose a
ConnectionFactory instance to the ApplicationContext.ConnectionFactory.public R2dbcDialect getDialect(ConnectionFactory connectionFactory)
R2dbcDialect for the given ConnectionFactory. This method attempts to resolve a
R2dbcDialect from ConnectionFactoryMetadata. Override this method to specify a dialect
instead of attempting to resolve one.connectionFactory - the configured ConnectionFactory.R2dbcDialect.DialectResolver.NoDialectException - if the R2dbcDialect cannot be determined.@Bean(value={"r2dbcDatabaseClient","databaseClient"}) public DatabaseClient databaseClient()
IllegalArgumentException - if any of the required args is null.@Bean public R2dbcEntityTemplate r2dbcEntityTemplate(DatabaseClient databaseClient, ReactiveDataAccessStrategy dataAccessStrategy)
databaseClient - must not be null.dataAccessStrategy - must not be null.@Bean public R2dbcMappingContext r2dbcMappingContext(Optional<org.springframework.data.relational.core.mapping.NamingStrategy> namingStrategy, R2dbcCustomConversions r2dbcCustomConversions)
R2dbcMappingContext and apply an optional NamingStrategy.namingStrategy - optional NamingStrategy. Use NamingStrategy.INSTANCE as fallback.r2dbcCustomConversions - customized R2DBC conversions.IllegalArgumentException - if any of the required args is null.@Bean public ReactiveDataAccessStrategy reactiveDataAccessStrategy(R2dbcConverter converter)
ReactiveDataAccessStrategy using the configured
R2dbcConverter.converter - the configured R2dbcConverter.IllegalArgumentException - if any of the mappingContext is null.r2dbcConverter(R2dbcMappingContext, R2dbcCustomConversions),
getDialect(ConnectionFactory)@Bean public MappingR2dbcConverter r2dbcConverter(R2dbcMappingContext mappingContext, R2dbcCustomConversions r2dbcCustomConversions)
R2dbcConverter using the configured
r2dbcMappingContext(Optional, R2dbcCustomConversions) R2dbcMappingContext}.mappingContext - the configured R2dbcMappingContext.r2dbcCustomConversions - customized R2DBC conversions.IllegalArgumentException - if any of the mappingContext is null.r2dbcMappingContext(Optional, R2dbcCustomConversions),
getDialect(ConnectionFactory)@Bean public R2dbcCustomConversions r2dbcCustomConversions()
Converters in a CustomConversions object if required. These
CustomConversions will be registered with the BasicRelationalConverter and
r2dbcMappingContext(Optional, R2dbcCustomConversions). Returns an empty R2dbcCustomConversions
instance by default. Override getCustomConverters() to supply custom converters.getCustomConverters()protected List<Object> getCustomConverters()
protected org.springframework.data.convert.CustomConversions.StoreConversions getStoreConversions()
R2dbcDialect-specific CustomConversions.StoreConversions.R2dbcDialect-specific CustomConversions.StoreConversions.Copyright © 2018–2023 Pivotal Software, Inc.. All rights reserved.