【问题标题】:jooQ code generation for particular tables为特定表生成 jooQ 代码
【发布时间】:2019-12-21 10:04:30
【问题描述】:

我有一个包含许多表的数据库。 我想开始在我的应用程序中使用 jOOQ。 但我不希望 JOOQ 为所有表生成代码,但只为一小部分表 如何配置?

【问题讨论】:

    标签: java jooq


    【解决方案1】:

    使用独立 XML 文件中的 jOOQ 生成器配置或内联在 Maven pom.xml 中的配置的相关部分可能如下所示:

    <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>
    

    有关编程配置或通过 Gradle 配置的更多详细信息或示例,请参阅手册:https://www.jooq.org/doc/latest/manual/code-generation/codegen-advanced/codegen-config-database/codegen-database-includes-excludes/

    【讨论】:

      猜你喜欢
      • 2014-09-09
      • 2017-12-03
      • 2017-08-13
      • 2020-01-23
      • 2014-03-06
      • 2016-09-04
      • 2016-06-12
      • 2020-12-23
      • 2016-11-22
      相关资源
      最近更新 更多