[
https://issues.apache.org/jira/browse/JDO-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963383#comment-16963383
]
Michael Bouschen edited comment on JDO-736 at 10/30/19 8:17 PM:
----------------------------------------------------------------
JDO now support more execute methods to avoid casting of the query result:
List<T> executeList();
T executeUnique();
<R> List<R> executeResultList(Class<R> resultCls);
<R> R executeResultUnique(Class<R> resultCls);
List<Object> executeResultList();
Object executeResultUnique();
The TCK test class SampleQueries use these new methods.
was (Author: mbo):
JDO now support more execute methods to avoid casting of the query result:
List<T> executeList();
T executeUnique();
<R> List<R> executeResultList(Class<R> resultCls);
<R> R executeResultUnique(Class<R> resultCls);
> Change Query API to make use of generics to avoid casting execute() results
> ---------------------------------------------------------------------------
>
> Key: JDO-736
> URL: https://issues.apache.org/jira/browse/JDO-736
> Project: JDO
> Issue Type: New Feature
> Components: api, specification, tck
> Reporter: Andy Jefferson
> Assignee: Michael Bouschen
> Priority: Major
> Fix For: JDO 3.2
>
> Attachments: JDO-736.patch
>
>
> The query API is dated, requiring casting of results to the required type.
> Let's make use of generics etc and remove the pain. This will mean changing
> the API so that the resultClass (and possibly more) will need passing into
> the
> execute() method(s). Could also specify parameters via setter rather than
> just on the execute.
> See JDO-652 also, we need to have a consistent way of executing queries
> whether created using strings or typesafe, so that no casting of results is
> needed with either
--
This message was sent by Atlassian Jira
(v8.3.4#803005)