com.bixuebihui.db.SqlLimit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of c-dbtools Show documentation
Show all versions of c-dbtools Show documentation
a fast small database connection pool and a active record flavor mini framework
package com.bixuebihui.db;
/**
* SqlLimit class.
*
* @author xingwx
* @version $Id: $Id
*/
public class SqlLimit {
/**
* Constant LIMIT_ONE
*/
public static final SqlLimit LIMIT_ONE= new SqlLimit(0, 1);
/** Constant LIMIT_MAX
*/
public static final SqlLimit LIMIT_MAX= new SqlLimit(0, 10000);
/**
* Constructor for SqlLimit.
*
* @param begin offset from begin, default 0.
* @param num count of record to return.
*/
public SqlLimit(int begin, int num) {
this.begin = begin;
this.num = num;
}
/**
* Constructor for SqlLimit.
*
* @param src a {@link SqlLimit} object.
*/
public SqlLimit(SqlLimit src) {
this.begin = src.begin;
this.num = src.num;
}
private int begin;
private int num;
/**
* Getter for the field begin
.
*
* @return an int.
*/
public int getBegin() {
return begin;
}
/**
* Setter for the field begin
.
*
* @param begin an int.
*/
public void setBegin(int begin) {
this.begin = begin;
}
/**
* Getter for the field num
.
*
* @return an int.
*/
public int getNum() {
return num;
}
/**
* getEnd.
*
* @return an int.
*/
public int getEnd(){
return begin + num;
}
/**
* Setter for the field num
.
*
* @param num an int.
*/
public void setNum(int num) {
this.num = num;
}
/**
* toString.
*
* @return a {@link java.lang.String} object.
*/
@Override
public String toString() {
return " limit " + begin + "," + num;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy