Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11
Include object types
Supported by ✅ 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>
<includeCheckConstraints>false</includeCheckConstraints>
<includeDomains>true</includeDomains>
<includeEmbeddables>true</includeEmbeddables>
<includeForeignKeys>false</includeForeignKeys>
<includeIndexes>false</includeIndexes>
<includeInvisibleColumns>true</includeInvisibleColumns>
<includePackageConstants>true</includePackageConstants>
<includePackageRoutines>true</includePackageRoutines>
<includePackageUDTs>true</includePackageUDTs>
<includePackages>true</includePackages>
<includePrimaryKeys>false</includePrimaryKeys>
<includeRoutines>true</includeRoutines>
<includeSequences>false</includeSequences>
<includeSynonyms>false</includeSynonyms>
<includeSystemCheckConstraints>false</includeSystemCheckConstraints>
<includeSystemIndexes>false</includeSystemIndexes>
<includeSystemSequences>false</includeSystemSequences>
<includeSystemTables>false</includeSystemTables>
<includeSystemUDTs>false</includeSystemUDTs>
<includeTables>true</includeTables>
<includeTriggerRoutines>false</includeTriggerRoutines>
<includeTriggers>true</includeTriggers>
<includeUDTs>true</includeUDTs>
<includeUniqueKeys>false</includeUniqueKeys>
<includeXMLSchemaCollections>false</includeXMLSchemaCollections>
</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()
.withIncludeCheckConstraints(false)
.withIncludeDomains(true)
.withIncludeEmbeddables(true)
.withIncludeForeignKeys(false)
.withIncludeIndexes(false)
.withIncludeInvisibleColumns(true)
.withIncludePackageConstants(true)
.withIncludePackageRoutines(true)
.withIncludePackageUDTs(true)
.withIncludePackages(true)
.withIncludePrimaryKeys(false)
.withIncludeRoutines(true)
.withIncludeSequences(false)
.withIncludeSynonyms(false)
.withIncludeSystemCheckConstraints(false)
.withIncludeSystemIndexes(false)
.withIncludeSystemSequences(false)
.withIncludeSystemTables(false)
.withIncludeSystemUDTs(false)
.withIncludeTables(true)
.withIncludeTriggerRoutines(false)
.withIncludeTriggers(true)
.withIncludeUDTs(true)
.withIncludeUniqueKeys(false)
.withIncludeXMLSchemaCollections(false)
)
)
See the configuration XSD and programmatic code generation for more details.
import org.jooq.meta.jaxb.*
configuration {
generator {
database {
isIncludeCheckConstraints = false
isIncludeDomains = true
isIncludeEmbeddables = true
isIncludeForeignKeys = false
isIncludeIndexes = false
isIncludeInvisibleColumns = true
isIncludePackageConstants = true
isIncludePackageRoutines = true
isIncludePackageUDTs = true
isIncludePackages = true
isIncludePrimaryKeys = false
isIncludeRoutines = true
isIncludeSequences = false
isIncludeSynonyms = false
isIncludeSystemCheckConstraints = false
isIncludeSystemIndexes = false
isIncludeSystemSequences = false
isIncludeSystemTables = false
isIncludeSystemUDTs = false
isIncludeTables = true
isIncludeTriggerRoutines = false
isIncludeTriggers = true
isIncludeUDTs = true
isIncludeUniqueKeys = false
isIncludeXMLSchemaCollections = false
}
}
}
See the configuration XSD and gradle code generation for more details.
configuration {
generator {
database {
includeCheckConstraints = false
includeDomains = true
includeEmbeddables = true
includeForeignKeys = false
includeIndexes = false
includeInvisibleColumns = true
includePackageConstants = true
includePackageRoutines = true
includePackageUDTs = true
includePackages = true
includePrimaryKeys = false
includeRoutines = true
includeSequences = false
includeSynonyms = false
includeSystemCheckConstraints = false
includeSystemIndexes = false
includeSystemSequences = false
includeSystemTables = false
includeSystemUDTs = false
includeTables = true
includeTriggerRoutines = false
includeTriggers = true
includeUDTs = true
includeUniqueKeys = false
includeXMLSchemaCollections = false
}
}
}
See the configuration XSD and gradle code generation for more details.
// The jOOQ-codegen-gradle plugin has been introduced in version 3.19. // Please use the official plugin instead of the third party plugin that was recommended before.
By default, most of these flags are set to true, with the exception of:
-
includeTriggerRoutines: Some databases store triggers as specialROUTINEtypes 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 auxiliaryCHECKconstraints for other constraints likeNOT NULLconstraints. The redundant information is usually undesirable, which is why these are turned off by default. -
includeSystemIndexes: Some databases produce auxiliaryINDEXobjects for other constraints likeFOREIGN KEYconstraints. These indexes are not independent from the key, and the redundant information is usually undesirable, which is why these are turned off by default. -
includeSystemSequences: Some database produce auxiliarySEQUENCEobjects to implement identities of tables. These sequences are usually not interesting to client code, which is why they are excluded by default. -
includeSystemTables: Some databases produce auxiliaryTABLEobjects to implement other types of tables, such as "virtual tables" (e.g. in SQLite). These implementation tables are usually not interesting for client code, which is why these are excluded by default. -
includeSystemUDTs: Some databases produce auxiliaryUDTobjects to implement other types of UDTs, such as "anonymous array types" (e.g. in Oracle for theCOLLECT()aggregate functions). These implementation UDTs are usually not interesting for client code, which is why these are excluded by default.
Feedback
Do you have any feedback about this page? We'd love to hear it!