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
The newest version!
/*
* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright Red Hat Inc. and Hibernate Authors
*/
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;
}
}