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 support for fetching 'TIMESTAMP(6) WITHOUT TIME ZONE' as LocalDate #1083

Merged
merged 1 commit into from Jan 21, 2018

Conversation

@alexanderkjall
Copy link
Contributor

@alexanderkjall alexanderkjall commented Jan 21, 2018

When fetching objects from an ResultSet, it would be convenient to be able to fetch timestamp columns as both LocalDateTime and LocalDate.

That enables me to write code like this:

        user.setToDate(rs.getObject("ToDate", LocalDate.class));

instead of having to check for null everywhere:

        LocalDateTime ldt = rs.getObject("ToDate", LocalDateTime.class);
        user.setToDate(ltd == null ? null : ltd);

@codecov-io
Copy link

@codecov-io codecov-io commented Jan 21, 2018

Codecov Report

Merging #1083 into master will increase coverage by 0.03%.
The diff coverage is 40%.

@@             Coverage Diff              @@
##             master    #1083      +/-   ##
============================================
+ Coverage      67.2%   67.23%   +0.03%     
- Complexity     3662     3665       +3     
============================================
  Files           170      170              
  Lines         15622    15627       +5     
  Branches       2523     2525       +2     
============================================
+ Hits          10498    10507       +9     
+ Misses         3937     3934       -3     
+ Partials       1187     1186       -1
@davecramer
Copy link
Member

@davecramer davecramer commented Jan 21, 2018

you will have to use
//#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.2"
around that code to conditionally compile it

@alexanderkjall
Copy link
Contributor Author

@alexanderkjall alexanderkjall commented Jan 21, 2018

@davecramer Thanks for the feedback, but I think it's already in an if block that starts at line 3359 in that file?

@davecramer
Copy link
Member

@davecramer davecramer commented Jan 21, 2018

fair enough I hadn't read the whole file.

@vlsi vlsi added this to the 42.2.1 milestone Jan 21, 2018
@vlsi vlsi merged commit 09af4b2 into pgjdbc:master Jan 21, 2018
2 checks passed
2 checks passed
codecov/project 67.23% (+0.03%) compared to 0d51370
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
rhavermans added a commit to bolcom/pgjdbc that referenced this pull request Jul 13, 2018
rhavermans added a commit to bolcom/pgjdbc that referenced this pull request Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants