@Test public void getLimitString() { Assert.assertEquals("select * from user limit 0", dialect.getLimitString("select * from user", 0, 0)); Assert.assertEquals("select * from user limit 12", dialect.getLimitString("select * from user", 0, 12)); Assert.assertEquals("select * from user limit 0 offset 12", dialect.getLimitString("select * from user", 12, 0)); Assert.assertEquals("select * from user limit 34 offset 12", dialect.getLimitString("select * from user", 12, 34)); }
public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { return new StringBuffer( sql.length()+20 ) .append(sql) .append(offset > 0 ? " limit "+limitPlaceholder+" offset "+offsetPlaceholder : " limit "+limitPlaceholder) .toString(); }
PostgreSQLDialect extends Dialect { public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { return new StringBuffer( sql.length()+20 ) .append(sql) .append(offset > 0 ? " limit "+limitPlaceholder+" offset "+offsetPlaceholder : " limit "+limitPlaceholder) .toString(); } }
PostgreSQLDialect extends Dialect { public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { return new StringBuffer( sql.length()+20 ) .append(sql) .append(offset > 0 ? " limit "+limitPlaceholder+" offset "+offsetPlaceholder : " limit "+limitPlaceholder) .toString(); }  }
PostgreSQLDialect extends Dialect { public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { return new StringBuffer( sql.length()+20 ) .append(sql) .append(offset > 0 ? " limit "+limitPlaceholder+" offset "+offsetPlaceholder : " limit "+limitPlaceholder) .toString(); }  boolean supportsLimit(); boolean supportsLimitOffset(); String getLimitString(String sql, int offset,
			String offsetPlaceholder, int limit, String limitPlaceholder); }
PostgreSQLDialect extends Dialect { public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { return new StringBuffer( sql.length()+20 ) .append(sql) .append(offset > 0 ? " limit "+limitPlaceholder+" offset "+offsetPlaceholder : " limit "+limitPlaceholder) .toString(); }  boolean supportsLimit(); boolean supportsLimitOffset(); String getLimitString(String sql, int offset,
			String offsetPlaceholder, int limit, String limitPlaceholder);  }