com.itranswarp.warpdb.Limit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of warpdb Show documentation
Show all versions of warpdb Show documentation
Simple, DSL-driven RDBMS interface for Java
package com.itranswarp.warpdb;
import java.util.List;
/**
* select ... from ... LIMIT ?, ?
*
* @author liaoxuefeng
*
* @param Generic type.
*/
public final class Limit extends CriteriaQuery {
Limit(Criteria criteria, int offset, int maxResults) {
super(criteria);
if (offset < 0) {
throw new IllegalArgumentException("offset must be >= 0.");
}
if (maxResults <= 0) {
throw new IllegalArgumentException("maxResults must be > 0.");
}
this.criteria.offset = offset;
this.criteria.maxResults = maxResults;
}
/**
* Get all results as list.
*
* @return List of object T.
*/
public List list() {
return criteria.list();
}
}