From 367c353499357ea28b31096a69257d20ce1c8569 Mon Sep 17 00:00:00 2001 From: izeye Date: Mon, 18 Jan 2021 09:54:32 +0900 Subject: [PATCH] Configure jOOQ ConnectionProvider via customizer See gh-24732 --- .../boot/autoconfigure/jooq/JooqAutoConfiguration.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java index 491575b58861..894c2c71187d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java @@ -94,18 +94,18 @@ public DefaultDSLContext dslContext(org.jooq.Configuration configuration) { @Bean @ConditionalOnMissingBean(org.jooq.Configuration.class) - public DefaultConfiguration jooqConfiguration(JooqProperties properties, ConnectionProvider connectionProvider, - DataSource dataSource, ObjectProvider configurationCustomizers) { + public DefaultConfiguration jooqConfiguration(JooqProperties properties, DataSource dataSource, + ObjectProvider configurationCustomizers) { DefaultConfiguration configuration = new DefaultConfiguration(); configuration.set(properties.determineSqlDialect(dataSource)); - configuration.set(connectionProvider); configurationCustomizers.orderedStream().forEach((customizer) -> customizer.customize(configuration)); return configuration; } @Bean @Deprecated - public DefaultConfigurationCustomizer jooQProviderDefaultConfigurationCustomizer( + public DefaultConfigurationCustomizer jooqProviderDefaultConfigurationCustomizer( + ObjectProvider connectionProvider, ObjectProvider transactionProvider, ObjectProvider recordMapperProvider, ObjectProvider recordUnmapperProvider, ObjectProvider settings, @@ -115,6 +115,7 @@ public DefaultConfigurationCustomizer jooQProviderDefaultConfigurationCustomizer ObjectProvider transactionListenerProviders, ObjectProvider executorProvider) { return new OrderedDefaultConfigurationCustomizer((configuration) -> { + connectionProvider.ifAvailable(configuration::set); transactionProvider.ifAvailable(configuration::set); recordMapperProvider.ifAvailable(configuration::set); recordUnmapperProvider.ifAvailable(configuration::set);