Available in versions: Dev (3.19) | Latest (3.18) | 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:
<configuration> <generator> <database> <includeTables>true</includeTables> <includeInvisibleColumns>true</includeInvisibleColumns> <includeEmbeddables>true</includeEmbeddables> <includeRoutines>true</includeRoutines> <includePackages>true</includePackages> <includePackageRoutines>true</includePackageRoutines> <includePackageUDTs>true</includePackageUDTs> <includePackageConstants>true</includePackageConstants> <includeUDTs>true</includeUDTs> <includeDomains>true</includeDomains> <includeSequences>false</includeSequences> <includePrimaryKeys>false</includePrimaryKeys> <includeUniqueKeys>false</includeUniqueKeys> <includeForeignKeys>false</includeForeignKeys> <includeCheckConstraints>false</includeCheckConstraints> <includeSystemCheckConstraints>false</includeSystemCheckConstraints> <includeIndexes>false</includeIndexes> <includeSystemIndexes>false</includeSystemIndexes> </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) .withIncludeInvisibleColumns(true) .withIncludeEmbeddables(true) .withIncludeRoutines(true) .withIncludePackages(true) .withIncludePackageRoutines(true) .withIncludePackageUDTs(true) .withIncludePackageConstants(true) .withIncludeUDTs(true) .withIncludeDomains(true) .withIncludeSequences(false) .withIncludePrimaryKeys(false) .withIncludeUniqueKeys(false) .withIncludeForeignKeys(false) .withIncludeCheckConstraints(false) .withIncludeSystemCheckConstraints(false) .withIncludeIndexes(false) .withIncludeSystemIndexes(false) ) )
See the configuration XSD andprogrammatic code generation for more details.
generationTool { generator { database { includeTables = true includeInvisibleColumns = true includeEmbeddables = true includeRoutines = true includePackages = true includePackageRoutines = true includePackageUDTs = true includePackageConstants = true includeUDTs = true includeDomains = true includeSequences = false includePrimaryKeys = false includeUniqueKeys = false includeForeignKeys = false includeCheckConstraints = false includeSystemCheckConstraints = false includeIndexes = false includeSystemIndexes = false } } }
See the configuration XSD and gradle code generation for more details.
By default, most of these flags are set to true, with the exception of:
-
includeTriggerRoutines
: Some databases store triggers as specialROUTINE
types in the schema. These routines are not meant to be called directly, by clients, which is why their inclusion in code generation is undesirable. -
includeSystemCheckConstraints
: Some databases produce auxiliaryCHECK
constraints for other constraints likeNOT NULL
constraints. The redundant information is usually undesirable, which is why these are turned off by default. -
includeSystemIndexes
: Some databases produce auxiliaryINDEX
objects for other constraints likeFOREIGN KEY
constraints. These indexes are not independent from the key, and the redundant information is usually undesirable, which is why these are turned off by default.
Feedback
Do you have any feedback about this page? We'd love to hear it!