Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
One of the hurdles in creating a cleaner API for SQLTemplate is its support for parameter batches:
SQLTemplate template = ...
Map<String, Object>[] params = new Map<>[2];
params[0] = ..
params[1] = ..
sqlTemplate.setParams(params);
There's a very small performance benefit to using batches, as PreparedStatement is not precompiled between the batch bindings. So switching this form instance to QueryChain is not going to have much effect on speed, but makes things cleaner:
SQLTemplate template = ...;
Query[] queries = new Query[2];
queries[0] = template.queryQueryWithParameters(..);
queries[1] = template.queryQueryWithParameters(..);
QueryChain chain = new QueryChain(queries);
So going to deprecate parameter batches.
Attachments
Issue Links
- is depended upon by
-
CAY-1966 SQLTemplate/SQLSelect positional parameter binding
- Closed