-
Notifications
You must be signed in to change notification settings - Fork 349
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
Vastly refactored property --> jdbc value mapping api #1517
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ public ConversionService getConversionService() { | |
return conversionService; | ||
} | ||
|
||
public CustomConversions getConversions() { | ||
public CustomConversions getCustomConversions() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a breaking change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Idk, I just renamed it for readability, to not confuse it in the code with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not introduce breaking changes if you're looking for inclusion in a minor release. |
||
return conversions; | ||
} | ||
|
||
|
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 am not quite sure this is the right approach. Right below, there's a
getColumnType
method that operates on the level of a property.Conversion is supposed to take custom converters into account and depending on a database dialect, a SQLType might change.
I suppose we need a larger revision on the converter to ensure that we sketch out the possible cases for obtaining
SQLType
(string-based query, in the context of a property) and define a path forward regarding necessary changes.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.
Let me break my change into several parts:
The reason I introduced this method is to optimize the target
SQLType
search. The publicgetTargetSqlType(RelationalPersistentProperty<?> property)
is first resolving theClass
of the givenproperty
, and then it searches theSQLType
for the givenClass
. This method exists mainly if we already know, whatClass
actually backs the property, so we do not need to do discover it over and over again.Now, let me explain my thoughts on your suggestions. I generally agree with you, that certainly makes sense, but this PR is solving another problem, and this problem of eliminating the incorrect conversions that are applied at the wrong times. See the bugs linked. I think we should do the following - if we recognize, that there is a need to determine the
SQLType
depending on the dialect (from some issue for instance), we're going to do so, but for now, I suggest leaving it as is.What are your thoughts on this, @mp911de?
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.
My main concern is that we're continuing to add functionality in terms of putting patches around something that is not designed in the right way instead of fixing the core issue.
I think @schauder should decide how to proceed here.