openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r617200 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestDistinctQueries.java
Date Thu, 31 Jan 2008 19:41:49 GMT
Author: pcl
Date: Thu Jan 31 11:41:46 2008
New Revision: 617200

URL: http://svn.apache.org/viewvc?rev=617200&view=rev
Log:
OPENJPA-135, OPENJPA-420 Merge from ../branches/1.0.x. svn merge -c 617164

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestDistinctQueries.java
      - copied unchanged from r617164, openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestDistinctQueries.java
Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java?rev=617200&r1=617199&r2=617200&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
Thu Jan 31 11:41:46 2008
@@ -395,6 +395,13 @@
 
         JPQLNode selectNode = root();
 
+        JPQLNode selectClause = selectNode.
+            findChildByID(JJTSELECTCLAUSE, false);
+        if (selectClause != null && selectClause.hasChildID(JJTDISTINCT))
+            exps.distinct = exps.DISTINCT_TRUE | exps.DISTINCT_AUTO;
+        else
+            exps.distinct = exps.DISTINCT_FALSE;
+
         JPQLNode constructor = selectNode.findChildByID(JJTCONSTRUCTOR, true);
         if (constructor != null) {
             // build up the fully-qualified result class name by
@@ -403,16 +410,8 @@
             exps.resultClass = resolver.classForName(resultClassName, null);
 
             // now assign the arguments to the select clause as the projections
-            exps.distinct = exps.DISTINCT_FALSE;
             return assignProjections(right(constructor), exps);
         } else {
-            JPQLNode selectClause = selectNode.
-                findChildByID(JJTSELECTCLAUSE, false);
-            if (selectClause != null && selectClause.hasChildID(JJTDISTINCT))
-                exps.distinct = exps.DISTINCT_TRUE | exps.DISTINCT_AUTO;
-            else
-                exps.distinct = exps.DISTINCT_FALSE;
-
             // handle SELECT clauses
             JPQLNode expNode = selectNode.
                 findChildByID(JJTSELECTEXPRESSIONS, true);



Mime
View raw message