Skip to content

Commit

Permalink
feat: adds JooqExceptionTranslator
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli authored Oct 5, 2023
1 parent e3b4a18 commit 3d43638
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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());
}
}

0 comments on commit 3d43638

Please sign in to comment.