Available in versions: Dev (3.21)
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.
Embedded columns (auto configuration)
Supported by ❌ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The configuration of embeddables can get quite verbose, especially if there's a 1:1 relationship between individual columns and generated embeddable types. A simple convenience configuration will allow for specifying all the columns for which an embeddable type of the form TABLENAME_COLUMNNAME should be auto-configured:
<configuration>
<generator>
<database>
<!-- Use regular expressions to match the qualified or unqualified column names that should be replaced by embeddables. -->
<embeddableColumns>email|currency</embeddableColumns>
</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()
// Use regular expressions to match the qualified or unqualified column names that should be replaced by embeddables.
.withEmbeddableColumns("email|currency")
)
)
See the configuration XSD and programmatic code generation for more details.
import org.jooq.meta.jaxb.*
configuration {
generator {
database {
// Use regular expressions to match the qualified or unqualified column names that should be replaced by embeddables.
embeddableColumns = "email|currency"
}
}
}
See the configuration XSD and gradle code generation for more details.
configuration {
generator {
database {
// Use regular expressions to match the qualified or unqualified column names that should be replaced by embeddables.
embeddableColumns = "email|currency"
}
}
}
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.
As always, when regular expressions are used, they are regular expressions with default flags.
This will automatically produce an embeddable type configuration for each matched table/column, with field replacement activated.
In case a column is already part of a embedded key or embedded domain, then those features will take precedence, and no additional embeddable type is generated.
Feedback
Do you have any feedback about this page? We'd love to hear it!