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

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

Outstanding questions :
1. Do we have JDOQLTypedQuery<T> and Query<T> ? or does Query just gain all of 
the extra methods from JDOQLTypedQuery? I suggest we have 2 classes since the 
distinction is significant. The fact that many methods are "fluent" now means 
we cannot have some common interface for both, since one would return Query<T> 
and the other return JDOQLTypedQuery<T>.

2. Do we bother with QueryExecution<T> since JDOQLTypedQuery is capable of 
having the result specified in the execute method (and hence being able to 
distinguish a return of List<Object> from List<Object[]>, whereas Query is not. 
Maybe just put the current QueryExecution methods on Query<T>?

3. Do we pass parameters in to the execute() or just have them as methods on 
the query? I suggest we have them as methods since we also have range() 
methods, and result(), and to have them on the execute methods we would 
presumably have to multiply the number of execute methods by 3, one taking no 
params, one taking a param Map (named params) and one taking a param array 
(numbered params).

4. 3) applies also for deletePersistentAll().

Comments?

> 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
>
>         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
(v6.3.4#6332)

Reply via email to