cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r685079 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
Date Tue, 12 Aug 2008 08:06:55 GMT
Author: aadamchik
Date: Tue Aug 12 01:06:55 2008
New Revision: 685079

URL: http://svn.apache.org/viewvc?rev=685079&view=rev
Log:
CAY-1093  better error message

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java?rev=685079&r1=685078&r2=685079&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
Tue Aug 12 01:06:55 2008
@@ -116,15 +116,19 @@
     public IncrementalFaultList(DataContext dataContext, Query query) {
         QueryMetadata metadata = query.getMetaData(dataContext.getEntityResolver());
         if (metadata.getPageSize() <= 0) {
-            throw new CayenneRuntimeException(
-                    "IncrementalFaultList does not support unpaged queries. Query page size
is "
-                            + metadata.getPageSize());
+            throw new CayenneRuntimeException("Not a paginated query; page size: "
+                    + metadata.getPageSize());
         }
 
         this.dataContext = dataContext;
         this.pageSize = metadata.getPageSize();
         this.rootEntity = metadata.getObjEntity();
 
+        if (rootEntity == null) {
+            throw new CayenneRuntimeException(
+                    "Pagination is not supported for queries not rooted in an ObjEntity");
+        }
+
         // create an internal query, it is a partial replica of
         // the original query and will serve as a value holder for
         // various parameters



Mime
View raw message