HHH-20302 Fix MAX/MIN on LocalDateTime and other java.time types when JAVA_TIME_USE_DIRECT_JDBC=true#12160
Conversation
|
Thanks for your pull request! This pull request appears to follow the contribution rules. › This message was automatically generated. |
mbellade
left a comment
There was a problem hiding this comment.
Thanks @MohammedAymanKhan, please squash everything to a single commit once you're done addressing the review comments.
c52f8a3 to
576a22c
Compare
mbellade
left a comment
There was a problem hiding this comment.
@MohammedAymanKhan there are failing tests, not all DBs support native JDBC handling of all Java time types probably. You can restrict the test to one that we know is working with e.g. RequiresDialect(H2Dialect.class) on the test-class.
Also please squash everything to a 1/2 commits which respect the contribution rules (message starts with Jira key).
|
… JAVA_TIME_USE_DIRECT_JDBC=true
2c530cb to
71a5f08
Compare
|
@MohammedAymanKhan please avoid merge commits, you should rebase on top of main instead. Please squash everything to a single commit. |



When
hibernate.type.java_time_use_direct_jdbc=true, aggregate functions such asMAX()andMIN()onLocalDateTime(and other java.time temporal types) failed with:Root cause:
The
ArgumentTypesValidatoronly checkedjdbcType.isComparable(), which returnsfalsefor the new internal SQL type codes (e.g.SqlTypes.LOCAL_DATE_TIME = 3009) used by the direct JDBC binding.Solution:
Updated
isCompatible()inArgumentTypesValidatorto also accept types wherejdbcType.isTemporal() == true.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
Please make sure that the following tasks are completed:
Tasks specific to HHH-20302 (Bug):
migration-guide.adocOR check there are no breaking changeshttps://hibernate.atlassian.net/browse/HHH-20302