r9902 - helma/helma/trunk/src/helma/objectmodel/db

[email protected] Tue, 15 Sep 2009 17:25:08 +0200 (CEST)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090915152508.40ED83D0E3@mia>
Author: hannes
Date: 2009-09-15 17:25:08 +0200 (Tue, 15 Sep 2009)
New Revision: 9902

Modified:
   helma/helma/trunk/src/helma/objectmodel/db/Relation.java
Log:
Fix access by name for collections with offset

Details at http://dev.helma.org/trac/helma/changeset/9902

Modified: helma/helma/trunk/src/helma/objectmodel/db/Relation.java
===================================================================
--- helma/helma/trunk/src/helma/objectmodel/db/Relation.java	2009-09-15 14:54:36 UTC (rev 9901)
+++ helma/helma/trunk/src/helma/objectmodel/db/Relation.java	2009-09-15 15:25:08 UTC (rev 9902)
@@ -971,7 +971,8 @@
             q.append(" ORDER BY ").append(order);
         }
 
-        if (maxSize > 0) {
+        // apply limit and offset, but not if the query is for a single object
+        if (maxSize > 0 && kstr == null) {
             if (otherType.isOracle()) {
                 // see http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
                 String selectItem = isCount ? "count(*)" : "*";