threeten-jpa icon indicating copy to clipboard operation
threeten-jpa copied to clipboard

Support Duration and Period with JDBC 4.2

Open marschall opened this issue 7 years ago • 5 comments

Support Duration and Period with JDBC 4.2 because ojdbc8 supports them.

marschall avatar Mar 21 '17 18:03 marschall

It's unclear what the JDBC type should be.

marschall avatar Apr 17 '17 12:04 marschall

I would like to see Duration support for postgres. Couldn't it be serialized via toNanos() and stored as a BIGINT?

Ramblurr avatar May 05 '17 08:05 Ramblurr

@Ramblurr Duration support for PostgreS is something I'd like to do.

Yes mapping nanos to BIGINT would be possible but I feel it's too semantically empty so this is not something I'm keen on doing. What would be more interesting in my opinion is mapping to the PostgreS interval type. I have not yet fully understood the semantics of a PostgreS interval, my current understanding is that it's a Period with sub-day precision.

marschall avatar May 05 '17 09:05 marschall

HSQLDB 2.4.0 does support INTERVAL and Duration and Period as well http://hsqldb.org/doc/guide/sqlgeneral-chapt.html#sgc_interval_typs

marschall avatar May 08 '17 19:05 marschall

So does H2 https://github.com/h2database/h2database/pull/1373

marschall avatar Feb 24 '19 14:02 marschall