@Override public LimitHandler getLimitHandler() { return new AbstractLimitHandler() { @Override public boolean supportsLimit() { return true; } @Override public String processSql(String sql, RowSelection selection) { if (LimitHelper.useLimit(this, selection)) { final boolean hasMaxRows = LimitHelper.hasMaxRows(selection); final boolean hasOffset = LimitHelper.hasFirstRow(selection); return sql + (hasMaxRows ? " limit ?" : "") + (hasOffset ? " offset ?" : ""); } return sql; } }; }