时区映射到 LocalDateTime 而不是 OffsetDateTime 的时间戳

timestamp with time zone mapped to LocalDateTime instead of OffsetDateTime

jooq 3.9 中新的 Java 时间特性似乎将 postgresql 的 timestamp with time zone 映射到 LocalDateTime 而我期望 OffsetDateTime.

这是预期的吗?


示例:我有一个这样的 postgres table:

CREATE TABLE so_table (
  id serial PRIMARY KEY,
  ts timestamp with time zone
);

我在我的 pom 中包含 <javaTimeTypes>true</javaTimeTypes>,生成的 class 包含此方法:

public LocalDateTime getTs() {
    return (LocalDateTime) get(1);
}

Is that expected?

是也不是。不幸的是,在 3.9 版中,TIMESTAMP WITH TIME ZONE 数据类型支持尚未包含在代码生成器中:https://github.com/jOOQ/jOOQ/issues/5734