【发布时间】:2022-08-24 21:37:07
【问题描述】:
jOOQ 的代码生成器支持<includes> 和<excludes> 元素通过使用静态正则表达式在代码生成中包含和排除对象。例如:
<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。这些正则表达式是静态的。有没有办法动态包含或排除对象,例如基于表格的某些属性?例如,我想排除在 PostgreSQL 数据库中生成的所有视图。
这一直是其他论坛的常见问题,现在有一个答案,which is why I\'m documenting it here。
标签: java sql code-generation jooq