cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r709927 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSelectTranslator.java
Date Sun, 02 Nov 2008 20:57:51 GMT
Author: aadamchik
Date: Sun Nov  2 12:57:51 2008
New Revision: 709927

URL: http://svn.apache.org/viewvc?rev=709927&view=rev
Log:
Add LIMIT / OFFSET clause generation method to SelectTranslator lifecycle

 switching Openbase to the new lifecycle method for LIMIT/OFFSET

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSelectTranslator.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSelectTranslator.java?rev=709927&r1=709926&r2=709927&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSelectTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSelectTranslator.java
Sun Nov  2 12:57:51 2008
@@ -34,17 +34,11 @@
     }
 
     @Override
-    public String createSqlString() throws Exception {
-        String sql = super.createSqlString();
-
-        if (!isSuppressingDistinct()) {
-            // limit results
-            int limit = getQuery().getMetaData(getEntityResolver()).getFetchLimit();
-            if (limit > 0) {
-                return sql + " RETURN RESULTS " + limit;
-            }
+    protected void appendLimitAndOffsetClauses(StringBuilder buffer) {
+        int limit = getQuery().getMetaData(getEntityResolver()).getFetchLimit();
+        if (limit > 0) {
+            buffer.append(" RETURN RESULTS ").append(limit);
         }
-
-        return sql;
     }
+
 }



Mime
View raw message