All versions: 3.11 | 3.10 | 3.9 | 3.8 | 3.7 | Development versions: 3.12 | Unsupported versions: 3.6 | 3.5 | 3.4 | 3.3 | 3.2

Configuring your code generator with Java, Groovy, etc.

In the previous sections, we have covered how to set up jOOQ's code generator using XML, either by running a standalone Java application, or by using Maven. However, it is also possible to use jOOQ's GenerationTool programmatically. The XSD file used for the configuration ( is processed using XJC to produce Java artefacts. The below example uses those artefacts to produce the equivalent configuration of the previous PostgreSQL / Maven example:

// Use the fluent-style API to construct the code generator configuration
import org.jooq.util.jaxb.*;

// [...]

Configuration configuration = new Configuration()
    .withJdbc(new Jdbc()
    .withGenerator(new Generator()
        .withDatabase(new Database()
        .withTarget(new Target()


For the above example, you will need all of jooq-3.2.7.jar, jooq-meta-3.2.7.jar, and jooq-codegen-3.2.7.jar, on your classpath.

The jOOQ Logo