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