openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r811159 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java
Date Thu, 03 Sep 2009 22:34:08 GMT
Author: fancy
Date: Thu Sep  3 22:34:08 2009
New Revision: 811159

URL: http://svn.apache.org/viewvc?rev=811159&view=rev
Log:
OPENJPA-1287 Criteria query to generate 'optimize for 1 row' for DB2 if selection is an aggregate
function

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?rev=811159&r1=811158&r2=811159&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Thu
Sep  3 22:34:08 2009
@@ -446,7 +446,7 @@
             assertOpen();
             if (_unique != null)
                 return _unique.booleanValue();
-            if (_query == null || _compiling || _broker == null)
+            if ((_query == null && _language.endsWith("JPQL")) || _compiling || _broker
== null)
                 return false;
 
             // check again after compilation; maybe encoded in string

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java?rev=811159&r1=811158&r2=811159&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaExpressionBuilder.java
Thu Sep  3 22:34:08 2009
@@ -84,6 +84,7 @@
         exps.resultClass = q.getResultType();
         exps.shape = evalResultShape(q);
         exps.parameterTypes = q.getParameterTypes();
+        exps.isAggregate();
         return exps;
     }
 



Mime
View raw message