-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Support list in IN clause in NamedParameterJdbcTemplate.batchUpdate [SPR-17402] #21935
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
Comments
Fedor Bobin commented I have a fix.
|
Fedor Bobin commented |
Fedor Bobin commented Juergen Hoeller any updates? |
Juergen Hoeller commented I'll consider this for 5.1.3 still. That said, if there is a risk for subtle side effects, we might have to turn this into a 5.2 topic instead. |
Juergen Hoeller commented I went with a more extensive refactoring, inlining the batch update code into |
Yanming Zhou commented Does NamedParameterJdbcTemplate supports Array/Collection with IN clause like this now? String sql = "select * from users where id in (:ids)";
Map<String,Object> sqlParameterSource = Collections.singletonMap("ids", new Integer[]{1, 2, 3});
namedParameterJdbcTemplate.query(sql, sqlParameterSource, rowCallbackHandler); currently my workaround is expand sql to "select * from users where id in (:ids[0],:ids[1],:ids[2])".
|
Fedor Bobin commented Yes. It will work (if your batches has same size) |
Yanming Zhou commented Fedor Bobin It's seems not working, It's querying not updating, It's one single sql not batch update. |
If the Array/Collection size is different, It's seems not working. |
@niloay, this issue was closed 2.5 years ago. If you feel you have discovered a bug, please open a new issue. |
Fedor Bobin opened SPR-17402 and commented
It will be nice to allow do batch queries with list in IN clause. Now it is not supported because query is expanded but NamedParameterBatchUpdateUtils does not aware of it.
Issue Links:
Referenced from: pull request #1997, and commits a3d763d
2 votes, 4 watchers
The text was updated successfully, but these errors were encountered: