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

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

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 (Kotlin)
Gradle (Groovy)
Gradle (third party)
<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 and programmatic code generation for more details.

import org.jooq.meta.jaxb.*


configuration {
  generator {
    generate {

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

See the configuration XSD and gradle code generation for more details.

configuration {
  generator {
    generate {

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

See the configuration XSD and gradle code generation for more details.

generationTool {
  generator {
    generate {

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

See the configuration XSD and gradle code generation for more details.

Feedback

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

The jOOQ Logo