OPENJPA-447. It looks like some of our DBDictionaries might not be handling ranging properly even after this fix.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@596523 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Patrick Linskey 2007-11-20 03:05:36 +00:00
parent 1dcd7b1d75
commit d4e978f5ae
5 changed files with 10 additions and 5 deletions

View File

@ -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));

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -241,7 +241,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)