From befd295ea53b72ff8d925e7c502e67fa6b2c5a1e Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Wed, 6 Feb 2008 23:05:54 +0000 Subject: [PATCH] OPENJPA-447. Merge from ../../trunk. svn merge -c 596523, plus correction to 596661 merge git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@619212 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/jdbc/sql/AbstractSQLServerDictionary.java | 3 ++- .../main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java | 3 ++- .../main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java | 3 ++- .../main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java | 3 ++- .../java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java | 3 ++- .../apache/openjpa/persistence/query/TestQueryPagination.java | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractSQLServerDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractSQLServerDictionary.java index d2f68b5e8..1d88edf4a 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractSQLServerDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractSQLServerDictionary.java @@ -108,7 +108,8 @@ public abstract class AbstractSQLServerDictionary super.setNull(stmnt, idx, colType, col); } - protected void appendSelectRange(SQLBuffer buf, long start, long end) { + protected void appendSelectRange(SQLBuffer buf, long start, long end, + boolean subselect) { // cannot use a value here, since SQLServer does not support // bound parameters in a "TOP" clause buf.append(" TOP ").append(Long.toString(end)); diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java index 7e0f19f7e..6c0b90c18 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java @@ -185,7 +185,8 @@ public class H2Dictionary extends DBDictionary { return cols; } - protected void appendSelectRange(SQLBuffer buf, long start, long end) { + protected void appendSelectRange(SQLBuffer buf, long start, long end, + boolean subselect) { if (end != Long.MAX_VALUE) buf.append(" LIMIT ").appendValue(end - start); if (start != 0) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java index 9a241a518..fc8d75605 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java @@ -250,7 +250,8 @@ public class HSQLDictionary } } - protected void appendSelectRange(SQLBuffer buf, long start, long end) { + protected void appendSelectRange(SQLBuffer buf, long start, long end, + boolean subselect) { // HSQL doesn't parameters in range buf.append(" LIMIT ").append(String.valueOf(start)).append(" "); if (end == Long.MAX_VALUE) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java index 9ac48534b..e359a114b 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java @@ -162,7 +162,8 @@ public class MySQLDictionary } } - protected void appendSelectRange(SQLBuffer buf, long start, long end) { + protected void appendSelectRange(SQLBuffer buf, long start, long end, + boolean subselect) { buf.append(" LIMIT ").appendValue(start).append(", "); if (end == Long.MAX_VALUE) buf.appendValue(Long.MAX_VALUE); diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java index a6bd7a4b0..8fff8c718 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java @@ -240,7 +240,8 @@ public class PostgresDictionary stmnt.setNull(idx, colType); } - protected void appendSelectRange(SQLBuffer buf, long start, long end) { + protected void appendSelectRange(SQLBuffer buf, long start, long end, + boolean subselect) { if (end != Long.MAX_VALUE) buf.append(" LIMIT ").appendValue(end - start); if (start != 0) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryPagination.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryPagination.java index d3d83dff3..654647ced 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryPagination.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestQueryPagination.java @@ -97,7 +97,7 @@ public class TestQueryPagination DBDictionary dict = ((JDBCConfiguration) emf.getConfiguration()) .getDBDictionaryInstance(); if (dict.supportsSelectStartIndex || dict.supportsSelectEndIndex) - assertNotEquals(noRange, withRange); + assertFalse(noRange.equals(withRange)); else assertEquals(noRange, withRange); }