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

By default the code generator produces Java files for use with the jOOQ API as documented throughout this manual. In some cases, however, it may be desireable to generate other meta data formats, such as an XML document. This can be done with the XMLGenerator.

The format produced by the XMLGenerator is the same as the one consumed by the XMLDatabase, which can read such XML content to produce Java code. It is specified in the http://www.jooq.org/xsd/jooq-meta-3.11.0.xsd schema. Essentially, this schema is an XML representation of the SQL standard INFORMATION_SCHEMA, as implemented by databases like H2, HSQLDB, MySQL, PostgreSQL, or SQL Server.

In order to use the XMLGenerator, simply place the following class reference into your code generation configuration:

XML configuration (standalone and Maven)

<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd">
  <generator>
    <name>org.jooq.codegen.XMLGenerator</name>
  </generator>
  ...
</configuration>

Programmatic configuration

configuration.withGenerator(new Generator()
  .withName("org.jooq.codegen.XMLGenerator"));

Gradle configuration

myConfigurationName(sourceSets.main) {
  generator {
    name = 'org.jooq.codegen.XMLGenerator'
  }
}

This configuration does not interfere with most of the remaining code generation configuration, e.g. you can still specify the JDBC connection or the generation output target as usual.

The jOOQ Logo