Available in versions: Dev (3.18) | Latest (3.17) | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9

Include object types

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

Sometimes, you want to generate only tables. Or only routines. Or you want to exclude them from being generated. Whatever the use-case, there's a way to do this with the following, additional includes flags:

XML (standalone and maven)
Programmatic
Gradle
<configuration>
  <generator>
    <database>
      <includeTables>true</includeTables>
      <includeRoutines>true</includeRoutines>
      <includePackages>true</includePackages>
      <includeUDTs>true</includeUDTs>
      <includeSequences>false</includeSequences>
      <includePrimaryKeys>false</includePrimaryKeys>
      <includeUniqueKeys>false</includeUniqueKeys>
      <includeForeignKeys>false</includeForeignKeys>
      <includeIndexes>false</includeIndexes>
    </database>
  </generator>
</configuration>

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

new org.jooq.meta.jaxb.Configuration()
  .withGenerator(new Generator()
    .withDatabase(new Database()
      .withIncludeTables(true)
      .withIncludeRoutines(true)
      .withIncludePackages(true)
      .withIncludeUDTs(true)
      .withIncludeSequences(false)
      .withIncludePrimaryKeys(false)
      .withIncludeUniqueKeys(false)
      .withIncludeForeignKeys(false)
      .withIncludeIndexes(false)
    )
  )

See the configuration XSD andprogrammatic code generation for more details.

myConfigurationName(sourceSets.main) {
  generator {
    database {
      includeTables = true
      includeRoutines = true
      includePackages = true
      includeUDTs = true
      includeSequences = false
      includePrimaryKeys = false
      includeUniqueKeys = false
      includeForeignKeys = false
      includeIndexes = false
    }
  }
}

See the configuration XSD andgradle code generation for more details.

By default, all these flags are set to true.

Feedback

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

The jOOQ Logo