3

Using JOOQ 3.10.1, I believe that the javaTimeTypes flag is on by default for the code generator.

I have a table in a PostgreSQL database with a date column and a time with time zone column:

  • the time with time zone column becomes an OffsetDateTime in the record class, as expected.
  • the date becomes java.sql.Date in the record class when I would have expected a LocalDate.

Am I missing anything here?

2
  • Don't know if it will help, but there is something about converters here, including a LocalDateConverter : jooq.org/doc/3.7/manual/sql-building/queryparts/custom-bindings . Commented Oct 16, 2017 at 15:27
  • That's what I have been using before 3.10 indeed but it should not be necessary any longer. Commented Oct 16, 2017 at 15:30

1 Answer 1

1

Using JOOQ 3.10.1, I believe that the javaTimeTypes flag is on by default for the code generator.

Here's the specification: https://www.jooq.org/xsd/jooq-codegen-3.10.0.xsd

<element name="javaTimeTypes" type="boolean" default="false" minOccurs="0" maxOccurs="1">..

So, no, it is not turned on by default.

the time with time zone column becomes an OffsetDateTime in the record class, as expected.

That's because there's no other type that can meaningfully represent the time with time zone data type.

Sign up to request clarification or add additional context in comments.

2 Comments

Mmm - worst bit is probably that I did check the xsd and concluded that it defaulted to true - probably need to ask an optician instead of stackoverflow! All sorted thanks.
@assylias: Well, now it's documented here as well for future visitors who might not know that the XSD exists :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.