db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Bouschen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JDO-652) Provision of a typesafe refactor-friendly query capability for JDOQL
Date Thu, 19 May 2011 19:06:47 GMT

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

Michael Bouschen commented on JDO-652:

I looked at the JDOQL "typesafe" query API. 

The expression syntax is looking good, but I have some questions about the handling of query
parameters and specifying the query result. My concern is that the typesafe query API is using
a very different aproach compared to the regular JDO queries. 

- Parameter handling: 
The typesafe query API uses a method setParameter to set the parameter value, meaning the
parameters values are part of the state of the TypesafeQuery instance. With JDO queries parameter
values are passed as arguments to the Query.execute call and not stored in the Query state.

- Query result specification:
The typesafe query API used a special execute method executeResultList to specify the query
result, e.g. tq.executeResultList(String.class, false, cand.lastname). At first glance this
looks like an execute call taking parameter values, but it is not. The reason might be, that
this aproach allows tempating on the query result. An alternative would be specifying the
query result type as a tempate argument of the TypesafeQuery instance, in addition to the
candidate class.

What do you think?

> Provision of a typesafe refactor-friendly query capability for JDOQL
> --------------------------------------------------------------------
>                 Key: JDO-652
>                 URL: https://issues.apache.org/jira/browse/JDO-652
>             Project: JDO
>          Issue Type: New Feature
>          Components: api, specification, tck
>            Reporter: Andy Jefferson
>             Fix For: JDO 3 maintenance release 1
>         Attachments: typesafe.patch, typesafe_manifest.patch
> There are various querying capabilities of this type around. JPA2 has its Criteria query
API. Third party solutions like QueryDSL also exist, in its case providing a JDOQL implementation
(as well as JPQL, and HQL). We should seriously consider introducing something along these
lines in the JDO2.4 timeframe. 
> There is a comparison of JPA Criteria with QueryDSL over at 
> http://source.mysema.com/forum/mvnforum/viewthread_thread,49

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message