jOOQ's code generator supports <includes> and <excludes> elements to include and exclude objects from code generation by using a static regular expression. For example:
<configuration>
<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>
As documented in the manual. These regular expressions are static. Is there any way to dynamically include or exclude objects, e.g. based on some property of a table? For example, I would like to exclude all views from being generated in a PostgreSQL database.
This has been a frequent question in other forums, which now has an answer, which is why I'm documenting it here.