Available in versions: Dev (3.18) | Latest (3.17)

Text blocks

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

By default, jOOQ's code generator produces Java 15 text blocks for generated source code (e.g. views, check constraints, etc.) if your Java version is up to date. In some cases, it may be desirable to turn that off:

XML (standalone and maven)
Programmatic
Gradle
<configuration>
  <generator>
    <generate>
      <!-- Options include:
           - DETECT_FROM_JDK (default, generate text blocks if Java version supports them)
           - ON
           - OFF
        -->
      <textBlocks>OFF</textBlocks>
    </generate>
  </generator>
</configuration>

See the configuration XSD, standalone code generation, and maven code generation for more details.

new org.jooq.meta.jaxb.Configuration()
  .withGenerator(
    new Generate()

      // Options include:
      // - DETECT_FROM_JDK (default, generate text blocks if Java version supports them)
      // - ON
      // - OFF
      .withTextBlocks(GeneratedTextBlocks.OFF)
  )

See the configuration XSD andprogrammatic code generation for more details.

myConfigurationName(sourceSets.main) {
  generator {
    generate {

      // Options include:
      // - DETECT_FROM_JDK (default, generate text blocks if Java version supports them)
      // - ON
      // - OFF
      textBlocks = 'OFF'
    }
  }
}

See the configuration XSD andgradle code generation for more details.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo