如何让 JOOQ 同时生成枚举类型和自定义类型?
How to make JOOQ generate both enum types and custom types?
我正在使用 JOOQ-codegen 3.6.1。
当我生成我的代码时,它通常可以很好地生成所有枚举类型。但是,当我像这样添加自定义类型时,JOOQ 停止生成枚举:
<customTypes>
<customType>
<name>LocalDateTime</name>
<type>java.time.LocalDateTime</type>
<converter>com.example.util.LocalDateTimeConverter</converter>
</customType>
</customTypes>
<forcedTypes>
<forcedType>
<name>LocalDateTime</name>
<types>TIMESTAMP</types>
</forcedType>
</forcedTypes>
LocalDateTime 数据类型在这种情况下生成得很好。我似乎无法找到生成枚举和自定义数据类型的方法。
当有自定义数据类型时,JOOQ 似乎甚至没有检测到枚举,因为我收到日志消息:
INFO: Enums fetched : 0 (0 included, 0 excluded)
有什么想法吗?
我认为这是 jOOQ 中的一个错误,我在这里报告了它:https://groups.google.com/forum/#!topic/jooq-user/ENPvgqtVwW0
作为一种变通方法,您可以避免使用 过滤器并始终对 select 列使用 过滤器。
我正在使用 JOOQ-codegen 3.6.1。
当我生成我的代码时,它通常可以很好地生成所有枚举类型。但是,当我像这样添加自定义类型时,JOOQ 停止生成枚举:
<customTypes>
<customType>
<name>LocalDateTime</name>
<type>java.time.LocalDateTime</type>
<converter>com.example.util.LocalDateTimeConverter</converter>
</customType>
</customTypes>
<forcedTypes>
<forcedType>
<name>LocalDateTime</name>
<types>TIMESTAMP</types>
</forcedType>
</forcedTypes>
LocalDateTime 数据类型在这种情况下生成得很好。我似乎无法找到生成枚举和自定义数据类型的方法。
当有自定义数据类型时,JOOQ 似乎甚至没有检测到枚举,因为我收到日志消息:
INFO: Enums fetched : 0 (0 included, 0 excluded)
有什么想法吗?
我认为这是 jOOQ 中的一个错误,我在这里报告了它:https://groups.google.com/forum/#!topic/jooq-user/ENPvgqtVwW0
作为一种变通方法,您可以避免使用