Postgres DATE column type

8 views
Skip to first unread message

eti...@gradle.com

unread,
Mar 21, 2018, 5:20:24 AM3/21/18
to jOOQ User Group
Hi

I'm curious why using the DATE column type in Postgres is not mapped to LocalDate in the Java code by jOOQ? I'm sure Lukas has a good reason, I'm just trying to understand it, before I write a custom converter from postgres' DATE to Java's LocalDate.

Regards, Etienne

Lukas Eder

unread,
Mar 21, 2018, 5:32:07 AM3/21/18
to jooq...@googlegroups.com
Hi Etienne,

1) Historically, the most appropriate type corresponding to SQL DATE is java.sql.Date in JDBC
2) jOOQ is a very historic API (i.e. backwards compatible)
3) The commercial distributions still support Java 6, so we still have to support java.sql.Date
4) You can turn on <javaTimeTypes/> in the code generator

Hope this helps
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eti...@gradle.com

unread,
Mar 22, 2018, 3:08:42 AM3/22/18
to jOOQ User Group
Hi Lukas

Thanks for the insights. It does help.
The javaTimeTypes I did not know of and is great to have available.

Etienne
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.

Lukas Eder

unread,
Mar 22, 2018, 3:52:51 AM3/22/18
to jooq...@googlegroups.com
2018-03-22 8:08 GMT+01:00 <eti...@gradle.com>:
The javaTimeTypes I did not know of and is great to have available.

Yeah, eventually, "true" will become the default for that flag, but the API is not fully ready yet. There are still some missing date time arithmetic methods that accept java.time types rather than java.sql types...

Cheers,
Lukas
Reply all
Reply to author
Forward
0 new messages