
jOOQ Masterclass
By :

We already know that jOOQ comes with three Code Generators (for Java, Scala, and Kotlin). For Java, we use org.jooq.codegen.JavaGenerator
, which can be shaped/customized declaratively (or, programmatically) via a comprehensive set of configurations grouped under <configuration>
(Maven), configurations
(Gradle), or org.jooq.meta.jaxb.Configuration
. But, sometimes, we need more control, or in other words, we need a custom generator implementation.
Imagine a scenario where we need a query method and it would be very handy if it was provided by the built-in jOOQ DAO. Obviously, the jOOQ goal is to maintain a thin DAO layer that avoids a large number of methods caused by different types of query combinations (don't expect to see in the default DAO a query method such as fetchByField1AndField2()
since trying to cover all combinations of fields (even for only two fields) leads to a heavy DAO layer that...