New versions: Dev (3.14) | Latest (3.13) | 3.12 | 3.11 | 3.10 | 3.9

Synthetic identities

Available in ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

jOOQ's code generator recognises identity columns if they are reported as such by the database. Some databases do not support "real" identity columns, but allow for emulating them, e.g. through triggers and sequences (e.g. Oracle prior to 12c). If a column is a known "identity" without formally being one, users can specify a regular expression that matches all columns (one column per table), which will be treated as if they were formal identities. For example:

XML configuration (standalone and Maven)

<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.13.0.xsd">
  <generator>
    <database>
      <syntheticIdentities>SCHEMA\.TABLE\.ID</syntheticIdentities>
    </database>
  </generator>
</configuration>

Programmatic configuration

new org.jooq.meta.jaxb.Configuration()
  .withGenerator(new Generator(
    .withDatabase(new Database()
      .withSyntheticIdentities("SCHEMA\.TABLE\.ID"))));

Gradle configuration

myConfigurationName(sourceSets.main) {
  generator {
    database {
      syntheticIdentities = 'SCHEMA\.TABLE\.ID'
    }
  }
}

Note again that these expressions are regular expressions with default flags

The jOOQ Logo