-
Notifications
You must be signed in to change notification settings - Fork 350
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
Address #1089 issue. Change ZonedDateTime conversion mechanism #1119
Conversation
@schauder I will also add dialect-specific
Problem - couple of drivers (MySQL jdbc driver for example) actually does not support values to be set in the way above via sqlType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left a couple of explanational comments, just to make it a little bit more easy to understand the reason behind some changes.
@@ -240,21 +251,6 @@ public Object readValue(@Nullable Object value, TypeInformation<?> type) { | |||
return super.readValue(value, type); | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can even remove this API, because parent method also perform the same null
check. Also if we assume that any external client also use this API, then they will not notice anything, because in this case they will just call parent writeValue
directly.
@@ -545,13 +548,26 @@ private IdentifierProcessing getIdentifierProcessing() { | |||
private void addConvertedPropertyValue(SqlIdentifierParameterSource parameterSource, | |||
RelationalPersistentProperty property, @Nullable Object value, SqlIdentifier name) { | |||
|
|||
addConvertedValue(parameterSource, value, name, converter.getColumnType(property), converter.getSqlType(property)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JdbcConverter#getSqlType
will invoke getColumnType
internaly. This is inefficient, since we already called converter#getColumnType()
for this RelationalPersistentProperty
Thanks for putting so much effort into this. I therefore won't accept the PR. Sorry. Apart from the main reason above I noticed a couple of things I'd like to point out, so they can be avoided in the future:
|
Addressing #1089 issue. Change
ZonedDateTime
mapping fromString
toZonedDateTime
, also makeZonedDateTime
to be treated asTypes.TIMESTAMP_WITH_TIMEZONE
. Also supplied with H2 reading converter forZonedDateTime
. @schauder, can you please review the changes?