[ad_1]
Ranging from Spring Boot 2.5, there’s a helpful new callback you can implement, referred to as DefaultConfigurationCustomizer
, the place the phrase DefaultConfiguration corresponds to jOOQ’s DefaultConfiguration
. You possibly can merely create a category like this in your undertaking:
import org.jooq.conf.RenderQuotedNames;
import org.jooq.impl.DefaultConfiguration;
import org.springframework.boot.autoconfigure.jooq.*;
import org.springframework.context.annotation.*;
@Configuration
public class Config {
@Bean
public DefaultConfigurationCustomizer configurationCustomiser() {
return (DefaultConfiguration c) -> c.settings()
.withRenderQuotedNames(
RenderQuotedNames.EXPLICIT_DEFAULT_UNQUOTED
);
}
}
The above callback receives the DefaultConfiguration
at its initialisation stage, throughout which you’ll be able to nonetheless safely mutate it to alter any of the defaults, or add further settings, and so forth. That’s it!
You possibly can set a breakpoint inside the lambda to validate when this initialisation is invoked:
Brought on by: java.lang.RuntimeException at org.jooq.instance.spring.Config.lambda$0(Config.java:30) at org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration$DslContextConfiguration.lambda$jooqConfiguration$1(JooqAutoConfiguration.java:104) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.settle for(ForEachOps.java:183) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at java.base/java.util.stream.SortedOps$RefSortingSink.finish(SortedOps.java:395) at java.base/java.util.stream.Sink$ChainedReference.finish(Sink.java:258) at java.base/java.util.stream.Sink$ChainedReference.finish(Sink.java:258) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.consider(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration$DslContextConfiguration.jooqConfiguration(JooqAutoConfiguration.java:104) at java.base/jdk.inside.replicate.NativeMethodAccessorImpl.invoke0(Native Methodology) at java.base/jdk.inside.replicate.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.inside.replicate.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.replicate.Methodology.invoke(Methodology.java:568) at org.springframework.beans.manufacturing unit.help.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ... 119 extra
To mess around with this instance, try our jOOQ-spring-boot-example on github.
[ad_2]