Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-15679 (
https://hibernate.atlassian.net/browse/HHH-15679?atlOrigin=eyJpIjoiNjQ1Nm...
)
Re: Use OffsetTime on JDBC level for TIME WITH TIME ZONE type (
https://hibernate.atlassian.net/browse/HHH-15679?atlOrigin=eyJpIjoiNjQ1Nm...
)
So I note that the linked stack overflow question is using a timetz column in Postgres
(which doesn’t really store the offset, it just converts to UTC), and a commenter replies
with a link to the Postgres wiki where they tell you to “Never” use timetz.
So I don’t think we should do anything to encourage this usage.
So what’s a sensible thing to do with an OffsetTime ? Currently, eyeballing the code, it
looks like we just throw away the offset and send the LocalTime part to the database. This
is pretty bad: it doesn’t even result in consistent interpretations of OffsetTime}}s in
the current JVM! But this is simply a bug in {{OffsetTimeJavaType I would say.
Well, I guess the only things that could possibly be reasonable would be:
* convert it to UTC before sending it to the database, or
* convert it to the JVM offset before sending it to the database.
Neither are great, but UTC looks better to me.
Alternatively, we could simply deprecate support for persisting {{OffsetTime}}s, and save
everyone a lot of head-scratching.
(
https://hibernate.atlassian.net/browse/HHH-15679#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15679#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:583150f )