|
|
|
|
@ -21,6 +21,7 @@ import javax.sql.DataSource;
@@ -21,6 +21,7 @@ import javax.sql.DataSource;
|
|
|
|
|
import org.jooq.ConnectionProvider; |
|
|
|
|
import org.jooq.DSLContext; |
|
|
|
|
import org.jooq.ExecuteListenerProvider; |
|
|
|
|
import org.jooq.ExecutorProvider; |
|
|
|
|
import org.jooq.RecordListenerProvider; |
|
|
|
|
import org.jooq.RecordMapperProvider; |
|
|
|
|
import org.jooq.RecordUnmapperProvider; |
|
|
|
|
@ -32,7 +33,6 @@ import org.jooq.impl.DataSourceConnectionProvider;
@@ -32,7 +33,6 @@ import org.jooq.impl.DataSourceConnectionProvider;
|
|
|
|
|
import org.jooq.impl.DefaultConfiguration; |
|
|
|
|
import org.jooq.impl.DefaultDSLContext; |
|
|
|
|
import org.jooq.impl.DefaultExecuteListenerProvider; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.ObjectProvider; |
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
|
|
|
|
@ -109,6 +109,8 @@ public class JooqAutoConfiguration {
@@ -109,6 +109,8 @@ public class JooqAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
private final TransactionListenerProvider[] transactionListenerProviders; |
|
|
|
|
|
|
|
|
|
private final ExecutorProvider executorProvider; |
|
|
|
|
|
|
|
|
|
public DslContextConfiguration(JooqProperties properties, |
|
|
|
|
ConnectionProvider connectionProvider, DataSource dataSource, |
|
|
|
|
ObjectProvider<TransactionProvider> transactionProvider, |
|
|
|
|
@ -118,7 +120,8 @@ public class JooqAutoConfiguration {
@@ -118,7 +120,8 @@ public class JooqAutoConfiguration {
|
|
|
|
|
ObjectProvider<RecordListenerProvider[]> recordListenerProviders, |
|
|
|
|
ExecuteListenerProvider[] executeListenerProviders, |
|
|
|
|
ObjectProvider<VisitListenerProvider[]> visitListenerProviders, |
|
|
|
|
ObjectProvider<TransactionListenerProvider[]> transactionListenerProviders) { |
|
|
|
|
ObjectProvider<TransactionListenerProvider[]> transactionListenerProviders, |
|
|
|
|
ObjectProvider<ExecutorProvider> executorProvider) { |
|
|
|
|
this.properties = properties; |
|
|
|
|
this.connection = connectionProvider; |
|
|
|
|
this.dataSource = dataSource; |
|
|
|
|
@ -131,6 +134,7 @@ public class JooqAutoConfiguration {
@@ -131,6 +134,7 @@ public class JooqAutoConfiguration {
|
|
|
|
|
this.visitListenerProviders = visitListenerProviders.getIfAvailable(); |
|
|
|
|
this.transactionListenerProviders = transactionListenerProviders |
|
|
|
|
.getIfAvailable(); |
|
|
|
|
this.executorProvider = executorProvider.getIfAvailable(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
@ -156,6 +160,9 @@ public class JooqAutoConfiguration {
@@ -156,6 +160,9 @@ public class JooqAutoConfiguration {
|
|
|
|
|
if (this.settings != null) { |
|
|
|
|
configuration.set(this.settings); |
|
|
|
|
} |
|
|
|
|
if (this.executorProvider != null) { |
|
|
|
|
configuration.set(this.executorProvider); |
|
|
|
|
} |
|
|
|
|
configuration.set(this.recordListenerProviders); |
|
|
|
|
configuration.set(this.executeListenerProviders); |
|
|
|
|
configuration.set(this.visitListenerProviders); |
|
|
|
|
|