Example usage for org.hibernate.dialect.pagination LimitHelper hasMaxRows

List of usage examples for org.hibernate.dialect.pagination LimitHelper hasMaxRows

Introduction

In this page you can find the example usage for org.hibernate.dialect.pagination LimitHelper hasMaxRows.

Prototype

public static boolean hasMaxRows(RowSelection selection) 

Source Link

Document

Is a max row limit indicated?

Usage

From source file:org.babyfish.hibernate.dialect.Oracle10gDialect.java

License:Open Source License

@Override
public LimitHandler buildDistinctLimitHandler(final String sql, final RowSelection selection) {
    return new AbstractLitmitHandlerWrapper(this.buildLimitHandler(sql, selection)) {
        @Override//from w ww  .j a  va 2 s.  co  m
        public String getProcessedSql() {
            boolean hasOffset = supportsLimit() && supportsLimitOffset() && LimitHelper.hasFirstRow(selection)
                    && LimitHelper.hasMaxRows(selection);
            return OracleDistinctLimits.getOracleDistinctLimitString(sql, hasOffset);
        }
    };
}

From source file:org.babyfish.hibernate.loader.DistinctLimitQueryLoader.java

License:Open Source License

@Override
protected LimitHandler getLimitHandler(String sql, RowSelection selection) {
    Dialect dialect = this.getFactory().getDialect();
    if (dialect instanceof DistinctLimitDialect && LimitHelper.hasMaxRows(selection)) {
        return ((DistinctLimitDialect) dialect).buildDistinctLimitHandler(sql, selection);
    }//from ww  w .ja va 2s. c om
    return super.getLimitHandler(sql, selection);
}