Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OffsetDateTime and Instant converters #38

Merged
merged 1 commit into from
Mar 12, 2018
Merged

Add OffsetDateTime and Instant converters #38

merged 1 commit into from
Mar 12, 2018

Conversation

gurpreet-
Copy link

I wanted all my TIMESTAMP_WITH_TIMEZONE columns to be Instants rather than OffsetDateTimes (I presume OffsetDateTime is default for the type TIMESTAMP_WITH_TIMEZONE in postgres). So I created a converter of the type Converter<OffsetDateTime, Instant> that converted TIMESTAMP_WITH_TIMEZONE types to Instants. I.e. OffsetDateTimes to Instants.

However, this resulted in a ClassCastException: String cannot be converted to OffsetDateTime stemming from the converter.from(OffsetDateTime) method in AbstractAsyncQueryExecutor.

It was trying to force a string type into the from method of my converter, where it should have been an OffsetDateTime.

This PR fixes that problem by introducing bindings to the OffsetDateTime and Instant types and so therefore allows OffsetDateTime and Instant types to be retrieved from databases.

Thanks 👍

I had a converter of the type Converter<OffsetDateTime, Instant> that converted TIMESTAMP_WITH_TIMEZONE types from OffsetDateTimes to Instants. However, this resulted in a 'ClassCastException: String cannot be converted to OffsetDateTime' stemming from the 'from(OffsetDateTime)' in the converter - line 47 in AbstractAsyncQueryExecutor. This change fixes that problem and allows OffsetDateTime and Instant types to be retrieved from databases.
@jklingsporn
Copy link
Owner

jklingsporn commented Mar 4, 2018 via email

@jklingsporn jklingsporn merged commit b9c28d3 into jklingsporn:release3.1.0 Mar 12, 2018
jklingsporn pushed a commit that referenced this pull request Mar 12, 2018
@gurpreet- gurpreet- deleted the patch-1 branch March 12, 2018 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants