diff --git a/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/config/JooqConfiguration.java b/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/config/JooqConfiguration.java index d1414cea1..209479227 100644 --- a/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/config/JooqConfiguration.java +++ b/r2dbc/boot-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/config/JooqConfiguration.java @@ -3,8 +3,11 @@ import io.r2dbc.spi.ConnectionFactory; import org.jooq.DSLContext; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultExecuteListenerProvider; +import org.springframework.boot.autoconfigure.jooq.JooqExceptionTranslator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; import org.springframework.data.r2dbc.config.EnableR2dbcAuditing; import org.springframework.r2dbc.connection.TransactionAwareConnectionFactoryProxy; @@ -16,4 +19,10 @@ public class JooqConfiguration { public DSLContext dslContext(ConnectionFactory connectionFactory) { return DSL.using(new TransactionAwareConnectionFactoryProxy(connectionFactory)).dsl(); } + + @Bean + @Order(0) + public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() { + return new DefaultExecuteListenerProvider(new JooqExceptionTranslator()); + } }