All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.itranswarp.warpdb.Limit Maven / Gradle / Ivy

There is a newer version: 6.0.3
Show newest version
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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy