首页 > 解决方案 > Character Set Problem In Jooq Model Generation

问题描述

I'm using PostgreSql and Jooq for my backend java project. Postgre Character Set UTF-8 Collation WIN1254 Turkish. Sample Table

BRAND -- TABLE

MODEL -- TABLE

'I' character is big 'i'. It is not 'ı' from Turkish letter.

Jooq generates model as 'BRANDİD' and 'getBrandıd'. 'getBrandıd' is not allowed to use in html. Spring gives error for this usage. I was tried changed character set for jooq model generation, but it did not work. Unsupported characters would be insterted in java model code as '?'. How can I resolve this problem?

标签: javamodel-view-controllerjooq

解决方案


A similar question was asked recently on the jOOQ user group:

The easiest way to fix this is to override the default Locale of your JVM that runs the code generation. E.g. using:

set MAVEN_OPTS= -Duser.language=en

This may be flaky of course, as some environments may not be configured correctly.

Another way to fix it is to write your own generator strategy:

There currently isn't any way to specify the code generation locale, though there should be. There's a pending feature request for this https://github.com/jOOQ/jOOQ/issues/9744


推荐阅读