package win.doyto.query.core;
public interface Dialect {
String buildPageSql(String sql, int limit, long offset);
default String wrapLabel(String fieldName) {
return fieldName;
}
}
public class HSQLDBDialect implements Dialect {
@Override
public String buildPageSql(String sql, int limit, long offset) {
return sql + " LIMIT " + limit + (sql.startsWith("SELECT") ? " OFFSET " + offset : "");
}
}
doyto:
query:
config:
dialect: win.doyto.query.demo.common.HsqldbDialect
GlobalConfiguration.instance().setDialect(new HSQLDBDialect())