-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed as not planned
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by another
Description
I would like to set my own Exception Translator or ExecuteListener to translate exception. Currently the exception is always translated twice.
Can't the bean be set conditionally? What is the use case for the Order to have 2 beans?
See JooqAutoConfiguration
@Bean
@Order(0)
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}Proposal if only 1 provider is necessary
@Bean
@ConditionalOnMissingBean
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}Quick Fix with order
@Bean
@Order(0)
@CondationalOnProperty("spring.xyz.jooq.translator.enabled")
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}Or own interface for jOOQ Bean Translator
public interface JooqExceptionTranslator extends ExecuteListener
@Bean
@Order(0)
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider(JooqExceptionTranslator translator) {
return new DefaultExecuteListenerProvider(translator);
}
@Bean
@ConditionalOnMissingBean
public JooqExceptionTranslator jooqExceptionTranslator() {
return new DefaultJooqExceptionTranslator();
}What do you think?
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by another