jooq 3.9 中新的 Java 时间功能似乎映射了 postgresql 的 timestamp with time zone
至LocalDateTime
而我期望 OffsetDateTime.
这是预期的吗?
示例:我有一个像这样的 postgres 表:
CREATE TABLE so_table (
id serial PRIMARY KEY,
ts timestamp with time zone
);
我包括<javaTimeTypes>true</javaTimeTypes>
在我的 pom 中,生成的类包含此方法:
public LocalDateTime getTs() {
return (LocalDateTime) get(1);
}
最佳答案
Is that expected?
是和否。不幸的是,在版本 3.9 中,代码生成器中尚未包含 TIMESTAMP WITH TIME ZONE
数据类型支持:https://github.com/jOOQ/jOOQ/issues/5734
关于java - 时区映射到 LocalDateTime 而不是 OffsetDateTime 的时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41445767/