[ 
https://issues.apache.org/jira/browse/JDO-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14521317#comment-14521317
 ] 

Andy Jefferson commented on JDO-736:
------------------------------------

+1 for the idea of putting those "execute" methods on a QueryProjector (or 
alternate name) INTERFACE ... see also 
https://issues.apache.org/jira/browse/JDO-652 at the end for Craig's comment 
(where it is called QueryExecution).

Not so keen on QueryResult, since people often pass the results of a query 
direct to other layers of their app, and having basic Java types (List) without 
the need to pull in any JDO baggage is my preference.


A separate thing on this issue, the existing methods
execute()
execute(Object)
execute(Object, Object)
execute(Object, Object, Object)

should be deprecated and just have 
execute(Object...)
which does the same as
executeWithArray(Object...)

> 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
>             Fix For: JDO 3.2
>
>
> 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
(v6.3.4#6332)

Reply via email to