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

com.github.drinkjava2.hibernate.RowSelection Maven / Gradle / Ivy

Go to download

jDialects is a pagination and DDL tool support ~80 databases, run on JDK8 or above

There is a newer version: 5.0.13.jre8
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package com.github.drinkjava2.hibernate;

/**
 * Represents a selection criteria for rows in a JDBC {@link java.sql.ResultSet}
 *
 * @author Gavin King
 * @author Yong Zhu(modify)
 */
public final class RowSelection {
	private Integer firstRow;
	private Integer maxRows;

	public RowSelection(int firstRow, int maxRows) {
		this.firstRow = firstRow;
		this.maxRows = maxRows;
	}

	public void setFirstRow(Integer firstRow) {
		this.firstRow = firstRow;
	}

	public void setFirstRow(int firstRow) {
		this.firstRow = firstRow;
	}

	public Integer getFirstRow() {
		return firstRow;
	}

	public void setMaxRows(Integer maxRows) {
		this.maxRows = maxRows;
	}

	public void setMaxRows(int maxRows) {
		this.maxRows = maxRows;
	}

	public Integer getMaxRows() {
		return maxRows;
	}

	public boolean definesLimits() {
		return maxRows != null || (firstRow != null && firstRow <= 0);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy