cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r572139 - /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/JpaQuery.java
Date Sun, 02 Sep 2007 20:12:29 GMT
Author: aadamchik
Date: Sun Sep  2 13:12:28 2007
New Revision: 572139

URL: http://svn.apache.org/viewvc?rev=572139&view=rev
Log:
support for setMaxResults

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/JpaQuery.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/JpaQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/JpaQuery.java?rev=572139&r1=572138&r2=572139&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/JpaQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/JpaQuery.java
Sun Sep  2 13:12:28 2007
@@ -33,6 +33,7 @@
 
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.QueryResponse;
+import org.apache.cayenne.query.EJBQLQuery;
 import org.apache.cayenne.query.ParameterizedQuery;
 import org.apache.cayenne.query.ProcedureQuery;
 import org.apache.cayenne.query.SQLTemplate;
@@ -152,7 +153,10 @@
         }
 
         // TODO: use QueryMetadata?
-        if (getQuery() instanceof SelectQuery) {
+        if (getQuery() instanceof EJBQLQuery) {
+            ((EJBQLQuery) getQuery()).setFetchLimit(maxResult);
+        }
+        else if (getQuery() instanceof SelectQuery) {
             ((SelectQuery) getQuery()).setFetchLimit(maxResult);
         }
         else if (getQuery() instanceof SQLTemplate) {



Mime
View raw message