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

org.hibernate.community.dialect.pagination.FirstLimitHandler Maven / Gradle / Ivy

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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy