timestamp with time zone mapped to LocalDateTime instead of OffsetDateTime

880 Views Asked by At

It seems that the new Java time feature in jooq 3.9 maps postgresql's timestamp with time zone to LocalDateTime whereas I would expect an OffsetDateTime.

Is that expected?


Example: I have a postgres table like this:

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

I include <javaTimeTypes>true</javaTimeTypes> in my pom and the generated class includes this method:

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

There are 1 best solutions below

3
On BEST ANSWER

Is that expected?

Yes and no. Unfortunately, in version 3.9, the TIMESTAMP WITH TIME ZONE data type support is not yet included in the code generator: https://github.com/jOOQ/jOOQ/issues/5734