Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 46144 invoked from network); 30 Oct 2010 17:42:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Oct 2010 17:42:42 -0000 Received: (qmail 99082 invoked by uid 500); 30 Oct 2010 17:42:42 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 99074 invoked by uid 99); 30 Oct 2010 17:42:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Oct 2010 17:42:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Oct 2010 17:42:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9UHgKhx005049 for ; Sat, 30 Oct 2010 17:42:20 GMT Message-ID: <21193436.157701288460540496.JavaMail.jira@thor> Date: Sat, 30 Oct 2010 13:42:20 -0400 (EDT) From: "Andy Jefferson (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Issue Comment Edited: (JDO-652) Provision of a statically-typed refactor-friendly query capability for JDOQL In-Reply-To: <8636188.18591271057620534.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JDO-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926213#action_12926213 ] Andy Jefferson edited comment on JDO-652 at 10/30/10 1:40 PM: -------------------------------------------------------------- Re: developing model and query objects, if someone wants to give it a try they can put "datanucleus-jdo-query.jar" (available in the DN nightly repo) in the Eclipse annotation processor jar list, enable JDK1.6 compliance, and also have "datanucleus-core.jar" in the CLASSPATH. They can then create a model class (e.g Product.java) and start writing persistence code that refers to QProduct, such as QProduct qp = QProduct.candidate; and start making references to "qp" and its various methods ... see http://datanucleus.blogspot.com/2010/07/jdo-typesafe-refactorable-queries.html for the expressions. This is the basis for the various clauses of the proposed query API Note this is not currently a full working prototype, it just allows creation of the dynamic query objects and can demonstrate the access of fields, use of methods and relations etc. An example of the API as currently in DataNucleus SVN Query q = pm.newTypesafeQuery(Product.class); QProduct cand = QProduct.candidate; q.filter(cand.value.lt(40.00).and(cand.name.startsWith("Wal"))).orderBy(cand.name.asc()); List results = q.executeList(); The "Query" object here is a different class to the javax.jdo.Query, could be renamed TypesafeQuery for example. The user can also type "q.toString()" to see the single-string equivalent. was (Author: andy): Re: developing model and query objects, if someone wants to give it a try they can put "datanucleus-jdo-query.jar" (available in the DN nightly repo) in the Eclipse annotation processor jar list, enable JDK1.6 compliance, and also have "datanucleus-core.jar" in the CLASSPATH. They can then create a model class (e.g Product.java) and start writing persistence code that refers to QProduct, such as QProduct qp = QProduct.candidate; and start making references to "qp" and its various methods ... see http://datanucleus.blogspot.com/2010/07/jdo-typesafe-refactorable-queries.html for the expressions. This is the basis for the various clauses of the proposed query API Note this is not currently a full working prototype, it just allows creation of the dynamic query objects and can demonstrate the access of fields, use of methods and relations etc. > Provision of a statically-typed 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 > > > 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. - You can reply to this email to add a comment to the issue online.