@Override public final SelectImpl limit(Param<Integer> numberOfRows) { this.limit = null; this.limitParam = numberOfRows; getQuery().addLimit(numberOfRows); return this; }
@Override public final SelectImpl limit(Param<Integer> offset, int numberOfRows) { getQuery().addLimit(offset, numberOfRows); return this; }
@Override public final SelectImpl limit(int numberOfRows) { this.limit = numberOfRows; this.limitParam = null; getQuery().addLimit(numberOfRows); return this; }
@Override public final SelectImpl limit(int offset, Param<Integer> numberOfRows) { getQuery().addLimit(offset, numberOfRows); return this; }
@Override public final SelectImpl limit(int offset, int numberOfRows) { getQuery().addLimit(offset, numberOfRows); return this; }
@Override public final SelectImpl limit(Param<Integer> offset, Param<Integer> numberOfRows) { getQuery().addLimit(offset, numberOfRows); return this; }
private final SelectImpl limitOffset() { if (limit != null) { if (offset != null) getQuery().addLimit(offset, limit); else if (offsetParam != null) getQuery().addLimit(offsetParam, limit); else getQuery().addLimit(limit); } else if (limitParam != null) { if (offset != null) getQuery().addLimit(offset, limitParam); else if (offsetParam != null) getQuery().addLimit(offsetParam, limitParam); else getQuery().addLimit(limitParam); } else { if (offset != null) getQuery().addOffset(offset); else if (offsetParam != null) getQuery().addOffset(offsetParam); } return this; }
protected void addLimit(SchemaFactory schemaFactory, String type, Pagination pagination, SelectQuery<?> query) { if (pagination == null || pagination.getLimit() == null) { return; } int limit = pagination.getLimit() + 1; int offset = getOffset(pagination); query.addLimit(offset, limit); }
select.addLimit(selectedPage * pageLimit, pageLimit);
select.addLimit(selectedPage * pageLimit, pageLimit);
select.addLimit(selectedPage * pageLimit, pageLimit);
query.addLimit(limit); query.addOffset(offset);