All versions: 3.11 | 3.10 | 3.9 | Development versions: 3.12

This mandatory top level configuration element wraps all the remaining configuration elements related to code generation, including the overridable code generator class.

XML configuration (standalone and Maven)

<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd">
  <generator>
    <!-- Optional: The fully qualified class name of the code generator. -->
    <name>...</name>
    
    <!-- Optional: The fully qualified class name of the generator strategy. -->
    <strategy>...</strategy>
    
    <!-- Optional: The jooq-meta configuration, configuring the information schema source. -->
    <database>...</database>
    
    <!-- Optional: The jooq-codegen configuration, configuring the generated output content. -->
    <generate>...</generate>
    
    <!-- Optional: The generation output target --> 
    <target>...</target>
  </generator>
</configuration>

Programmatic configuration

configuration
  .withGenerator(new Generator(
    .withName("...")
    .withStrategy(new Strategy())
    .withDatabase(new Database())
    .withGenerate(new Generate())
    .withTarget(new Target())));

Gradle configuration

myConfigurationName(sourceSets.main) {
  generator {
    name = '...'
    strategy { 
      ... 
    }
    database {
      ...
    }
    generate {
      ...
    }
    target {
      ...
    }
  }
}

Specifying your own generator

The <name/> element allows for specifying a user-defined generator implementation. This is mostly useful when generating custom code sections, which can be added programmatically using the code generator's internal API. For more details, please refer to the relevant section of the manual.

Specifying a strategy

jOOQ by default applies standard Java naming schemes: PascalCase for classes, camelCase for members, methods, variables, parameters, UPPER_CASE_WITH_UNDERSCORES for constants and other literals. This may not be the desired default for your database, e.g. when you strongly rely on case-sensitive naming and if you wish to be able to search for names both in your Java code and in your database code (scripts, views, stored procedures) uniformly. For that purpose, you can override the <strategy/> element with your own implementation, either:

For more details, please refer to the relevant sections, above.

jooq-meta and jooq-codegen configuration

The jOOQ Logo