db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r577406 - /db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java
Date Wed, 19 Sep 2007 18:04:15 GMT
Author: clr
Date: Wed Sep 19 11:04:14 2007
New Revision: 577406

URL: http://svn.apache.org/viewvc?rev=577406&view=rev
Log:
JDO-529 Add DISTINCT to query in ChangeQuery

Modified:
    db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java

Modified: db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java?rev=577406&r1=577405&r2=577406&view=diff
==============================================================================
--- db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java (original)
+++ db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java Wed Sep
19 11:04:14 2007
@@ -62,7 +62,7 @@
         Query query = getPM().newNamedQuery(Person.class, "changeQuery");
         
         // change query
-        query.setResult("firstname, lastname");
+        query.setResult("DISTINCT firstname, lastname");
         query.setResultClass(FullName.class);
         query.setClass(FullTimeEmployee.class);
         String filter = "salary > 1000 & projects.contains(p) & " +
@@ -73,14 +73,15 @@
         query.declareImports(imports);
         query.declareVariables("Project p");
         query.declareParameters("BigDecimal limit");
-        query.setOrdering("personid ASCENDING");
+        query.setOrdering("firstname, lastname ASCENDING");
         query.setRange(0, 5);
         String singleStringQuery = 
-            "SELECT firstname, lastname INTO FullName FROM FullTimeEmployee " +
+            "SELECT DISTINCT firstname, lastname " +
+            "INTO FullName FROM FullTimeEmployee " +
             "WHERE salary > 1000 & projects.contains(p) & " +
             "p.budget > limit " +
             "VARIABLES Project p PARAMETERS BigDecimal limit " +
-            "ORDER BY personid ASCENDING RANGE 0, 5";
+            "ORDER BY firstname, lastname ASCENDING RANGE 0, 5";
 
         // query parameters
         Object[] parameters = {new BigDecimal("2000")};        



Mime
View raw message