1

I'm successfully generating jOOQ classes using the jooq-codegen-maven plugin together with the jooq meta hibernate extension.

The names of the generated classes and methods for tables/column are using the actual DB table and column names.

Is possible for the generation to use on the @Entity class simple-name and the @Column instance variables names instead the @Entity(name=TABLE) and @Column(name=COLUMN) ?

To me it will be more intuitive to have the same names as the JPA classes when using jOOQ to create queries.

Thanks

4

1 回答 1

0

jOOQ 并不真正“了解”您的实体。在幕后,JPADatabase模拟了在实际数据库中为您的实体安装生成的 SQL(目前,从 jOOQ 3.15 开始,在 H2 中,但将来可能会改变)。从那时起,jOOQ 将继续连接到一个实际的数据库来进行逆向工程,而不知道这个模拟的数据库来自 JPA 实体。

因此,不可能“记住”您为这些表和列指定的替代名称。

但是,您可能知道并且有一些命名约定,您可以在生成器策略中对其进行编码。

于 2021-08-25T15:36:09.313 回答