IDEMPIERE-4182 Add Ini property to turn off Oracle to PostgreSQL translation. Fix paging not working for native dialect.

This commit is contained in:
hengsin 2020-03-10 09:47:26 +08:00
parent 0fd31674bb
commit 895f766307
1 changed files with 8 additions and 3 deletions

View File

@ -1044,9 +1044,14 @@ public class DB_PostgreSQL implements AdempiereDatabase
* @param end
*/
public String addPagingSQL(String sql, int start, int end) {
String newSql = sql + " " + NATIVE_MARKER + "LIMIT " + ( end - start + 1 )
+ " " + NATIVE_MARKER + "OFFSET " + (start - 1);
return newSql;
StringBuilder newSql = new StringBuilder(sql);
newSql.append(" ")
.append(markNativeKeyword("LIMIT "))
.append(( end - start + 1 ))
.append(" ")
.append(markNativeKeyword("OFFSET "))
.append((start - 1));
return newSql.toString();
}
public boolean isPagingSupported() {