-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Support for named parameters in SimpleJdbcCall
[SPR-12801]
#17398
Comments
Serge Shikov commented The same for MS SQL please. At the moment (in spring 3.x versions) the same call syntax is used, with positional parameters only: {call sp(?,?,?)} and it prevents us from using parameters defined with default values. |
Juergen Hoeller commented We're considering this for 4.2 now. A pull request would be very much appreciated and would strongly increase the chances of this making it into 4.2 RC1! Juergen |
Kiril Nugmanov commented Created pull #763 |
Stéphane Nicoll commented I have a candidate fix based on your PR and a few modifications (see this commit). I am still not sure if swapping the context is the right move. You may want to review the Spring Framework Code Style as it contains valuable resources regarding the code format and the structure of the commit message. |
Kiril Nugmanov commented Stéphane, Can you explain why such swapping might be wrong? |
Stéphane Nicoll commented Hey, I am not saying it's wrong. I am just confused about the approach of generating always "?" or always a named parameter for a given What's wrong with adding the parameter always? |
Kiril Nugmanov commented I think if you make named binding for Oracle/MS SQL as default for SimpleJdbcCall - previously working code might be broken. In existing code version there is no big deal how you name your parameters but in case of named parameters IS. |
Stéphane Nicoll commented Gotcha. What's the problem of adding a |
Kiril Nugmanov commented Adding setter in Current dependencies are following: |
Stéphane Nicoll commented Fixed in a slightly different way, adding the notion of named binding in the current A new |
SimpleJdbcCall
[SPR-12801]
Kiril Nugmanov opened SPR-12801 and commented
org.springframework.jdbc.core.simple.AbstractJdbcCall uses org.springframework.jdbc.core.metadata.CallMetaDataContext to generate JDBC statement.
In case of Oracle PL/SQL org.springframework.jdbc.core.metadata.CallMetaDataContext.createCallString can be changed to support default values by implementing following changes in constructing JDBC statement from:
to
Change can be implemented in 2 ways:
Related to #9084, #8193
Affects: 4.1.5
Reference URL: #763
Issue Links:
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: