org.hibernate.community.dialect.pagination.FirstLimitHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-community-dialects Show documentation
Show all versions of hibernate-community-dialects Show documentation
Hibernate's community supported dialects
/*
* 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 org.hibernate.community.dialect.pagination;
import org.hibernate.dialect.pagination.AbstractNoOffsetLimitHandler;
import org.hibernate.dialect.pagination.LimitHandler;
/**
* A {@link LimitHandler} for older versions of Informix, Ingres,
* and TimesTen, which supported the syntax {@code SELECT FIRST n}.
* Note that this syntax does not allow specification of an offset.
*
* @author Chris Cranford
*/
public class FirstLimitHandler extends AbstractNoOffsetLimitHandler {
public static final FirstLimitHandler INSTANCE = new FirstLimitHandler(false);
public FirstLimitHandler(boolean variableLimit) {
super(variableLimit);
}
@Override
protected String limitClause() {
return " first ?";
}
@Override
protected String insert(String first, String sql) {
return insertAfterSelect( first, sql );
}
@Override
public boolean bindLimitParametersFirst() {
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy