简体   繁体   中英

jOOQ ignores column name casing when generation code from Postgresql table

I'm using jOOQ 3.10.1 with Postgres JDBC driver 42.1.4 and trying to generate code for following table:

create table "SampleTable"(
    "ID" serial primary key,
    "AnotherField" integer
);

jOOQ generates following code:

public interface ISampletable extends Serializable {
    public Integer getId();
    public Integer getAnotherfield();
//...

How can i configure jOOQ to generate case-sensitive code?

By default, jOOQ's code generator follows Java's code style:

  • classes are generated in PascalCase
  • members and methods are generated in camelCase
  • identifiers are generated in UPPER_CASE_WITH_UNDERSCORE

But you can override this behaviour easily using a generator strategy. There are two flavours:

In your case, the configurative approach might do, or you can simply use the built-in org.jooq.codegen.KeepNamesGeneratorStrategy .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM