cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-1967) Deprecate SQLTemplate parameter batches
Date Sun, 02 Nov 2014 11:27:33 GMT

     [ https://issues.apache.org/jira/browse/CAY-1967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1967.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 4.0.M2

> Deprecate SQLTemplate parameter batches
> ---------------------------------------
>
>                 Key: CAY-1967
>                 URL: https://issues.apache.org/jira/browse/CAY-1967
>             Project: Cayenne
>          Issue Type: Improvement
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 4.0.M2
>
>
> 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. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message