All versions: 3.11 | Development versions: 3.12

A zero-scale decimal, such as DECIMAL(10) or NUMBER(10, 0) is really an integer type with a decimal precision rather than a binary / bitwise precision. Some databases (e.g. Oracle) do not support actual integer types at all, only decimal types. Historically, jOOQ generates the most appropriate integer wrapper type instead of BigDecimal or BigInteger:

If this is not a desireable default, it can be deactivated either explicitly on a per-column basis using forced types, or globally using the following flag:

XML configuration (standalone and Maven)

<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd">
  <generator>
    <generate>
      <forceIntegerTypesOnZeroScaleDecimals>true</forceIntegerTypesOnZeroScaleDecimals>
    </generate>
  </generator>
</configuration>

Programmatic configuration

configuration
  .withGenerator(new Generator(
    .withGenerate(new Generate()
      .withForceIntegerTypesOnZeroScaleDecimals(true))));

Gradle configuration

myConfigurationName(sourceSets.main) {
  generator {
    generate {
      forceIntegerTypesOnZeroScaleDecimals = true
    }
  }
}
The jOOQ Logo