I have a database with many tables. I want to start using jOOQ for my application. But I don't want JOOQ to generated code for all tables but only for small subset of tables How can I configure it?
1 Answers
0
votes
With the jOOQ generator configuration in a standalone XML file or inlined in your Maven pom.xml the relevant part of the configuration could look something like this:
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd">
<generator>
<database>
<includes>.*</includes>
<excludes>
UNUSED_TABLE # This table (unqualified name) should not be generated
| PREFIX_.* # Objects with a given prefix should not be generated
| SECRET_SCHEMA\.SECRET_TABLE # This table (qualified name) should not be generated
| SECRET_ROUTINE # This routine (unqualified name) ...
</excludes>
</database>
</generator>
</configuration>
For more details or examples for programmatic configuration or configuration via Gradle, refer to the manual: https://www.jooq.org/doc/latest/manual/code-generation/codegen-advanced/codegen-config-database/codegen-database-includes-excludes/.