-
Notifications
You must be signed in to change notification settings - Fork 356
Allow passing of tuples to methods #1838
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
Conversation
#1569 seems related. |
@@ -204,23 +207,47 @@ private void convertAndAddParameter(MapSqlParameterSource parameters, Parameter | |||
TypeInformation<?> typeInformation = parameter.getTypeInformation(); | |||
|
|||
JdbcValue jdbcValue; | |||
if (typeInformation.isCollectionLike() && value instanceof Collection<?>) { | |||
if (typeInformation.isCollectionLike() // |
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.
We should make our concepts more explicit. Binding a single value is fine. Binding a List
should become more explicit what we're up to. Binding a list of elements would result in parameter expansion while binding a list of arrays results in tuple expansion.
I suggest that we refactor the code a bit into a form that we extract methods and prepare the target types (i.e. actual type) so that we have a more explicit flow.
Let me know what you think.
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'm happy with that.
Are you thinking refactoring in the strict sense, i.e. we keep the behaviour as it is with this PR?
Refactor convertAndAddParameter method to writeValue(…) decoupling responsibilities for a clearer value conversion code path. Also, refactor collection conversion to functional callback-style and extend test assertions.
That's merged and backported now. |
Closes #1323
To be honest, I'm not sure if this is the right way to fix this. Could you take a hard critical look, please?