@Test public void getLimitStringWithPlaceHolader() { String OFFSET = ":offset"; String LIMIT = ":limit"; assertEquals("select * from user limit :limit", dialect.getLimitString("select * from user", 0,OFFSET, 0,LIMIT)); assertEquals("select * from user limit :limit", dialect.getLimitString("select * from user", 0,OFFSET,12,LIMIT)); assertEquals("select * from user limit :offset,:limit", dialect.getLimitString("select * from user", 12, OFFSET,0,LIMIT)); assertEquals("select * from user limit :offset,:limit", dialect.getLimitString("select * from user", 12,OFFSET, 34,LIMIT)); }
public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { if (offset > 0) { return sql + " limit "+offsetPlaceholder+","+limitPlaceholder; } else { return sql + " limit "+limitPlaceholder; } }
MySQLDialect extends Dialect { public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { if (offset > 0) { return sql + " limit "+offsetPlaceholder+","+limitPlaceholder; } else { return sql + " limit "+limitPlaceholder; } } }
MySQLDialect extends Dialect { public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { if (offset > 0) { return sql + " limit "+offsetPlaceholder+","+limitPlaceholder; } else { return sql + " limit "+limitPlaceholder; } }  }
MySQLDialect extends Dialect { public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { if (offset > 0) { return sql + " limit "+offsetPlaceholder+","+limitPlaceholder; } else { return sql + " limit "+limitPlaceholder; } }  boolean supportsLimitOffset(); boolean supportsLimit(); String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder); }
MySQLDialect extends Dialect { public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { if (offset > 0) { return sql + " limit "+offsetPlaceholder+","+limitPlaceholder; } else { return sql + " limit "+limitPlaceholder; } }  boolean supportsLimitOffset(); boolean supportsLimit(); String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder);  }