Java源码示例:org.jooq.impl.DefaultExecuteListenerProvider
示例1
private DSLContext getDslContext(PlatformTransactionManager txManager, DataSource dataSource) {
DefaultConfiguration config = new DefaultConfiguration();
config.set(new DataSourceConnectionProvider(new TransactionAwareDataSourceProxy(dataSource)));
config.set(new DefaultExecuteListenerProvider(new JooqExceptionTranslator()));
config.set(new SpringTransactionProvider(txManager));
return new DefaultDSLContext(config);
}
示例2
@Bean
public DefaultConfiguration configuration() {
DefaultConfiguration jooqConfiguration = new DefaultConfiguration();
jooqConfiguration.set(connectionProvider());
jooqConfiguration.set(new DefaultExecuteListenerProvider(exceptionTransformer()));
String sqlDialectName = environment.getRequiredProperty("jooq.sql.dialect");
SQLDialect dialect = SQLDialect.valueOf(sqlDialectName);
jooqConfiguration.set(dialect);
return jooqConfiguration;
}
示例3
public DefaultConfiguration configuration() {
DefaultConfiguration jooqConfiguration = new DefaultConfiguration();
jooqConfiguration.set(connectionProvider());
jooqConfiguration.set(new DefaultExecuteListenerProvider(new ExceptionTranslator()));
return jooqConfiguration;
}