@Override public boolean supportsLimitOffset() { return dialect.supportsLimitOffset(); }
public boolean isMatch(Dialect dialect) { return dialect.supportsLimit() && dialect.supportsLimitOffset(); } }
@Override public boolean supportsLimitOffset() { return dialect.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
@Override @Deprecated public boolean supportsLimitOffset() { return delegate.supportsLimitOffset(); }
/** * Fetch a <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, * advance to the first result and return an SQL <tt>ResultSet</tt> */ protected final ResultSet getResultSet( final PreparedStatement st, final boolean autodiscovertypes, final boolean callable, final RowSelection selection, final SessionImplementor session) throws SQLException, HibernateException { ResultSet rs = null; try { Dialect dialect = getFactory().getDialect(); rs = st.executeQuery(); rs = wrapResultSetIfEnabled( rs , session ); if ( !dialect.supportsLimitOffset() || !useLimit( selection, dialect ) ) { advance( rs, selection ); } if ( autodiscovertypes ) { autoDiscoverTypes( rs ); } return rs; } catch ( SQLException sqle ) { st.close(); throw sqle; } }
/** * Bind parameters needed by the dialect-specific LIMIT clause */ private int bindLimitParameters(final PreparedStatement st, final int index, final RowSelection selection) throws SQLException { Dialect dialect = getFactory().getDialect(); if ( !dialect.supportsVariableLimit() ) return 0; if ( !hasMaxRows( selection ) ) throw new AssertionFailure( "no max results set" ); int firstRow = getFirstRow( selection ); int lastRow = getMaxOrLimit( selection, dialect ); boolean hasFirstRow = firstRow > 0 && dialect.supportsLimitOffset(); boolean reverse = dialect.bindLimitParametersInReverseOrder(); if ( hasFirstRow ) st.setInt( index + ( reverse ? 1 : 0 ), firstRow ); st.setInt( index + ( reverse || !hasFirstRow ? 0 : 1 ), lastRow ); return hasFirstRow ? 2 : 1; }
/** * Fetch a <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, * advance to the first result and return an SQL <tt>ResultSet</tt> */ protected final ResultSet getResultSet( final PreparedStatement st, final boolean autodiscovertypes, final boolean callable, final RowSelection selection, final SessionImplementor session) throws SQLException, HibernateException { ResultSet rs = null; try { Dialect dialect = getFactory().getDialect(); rs = st.executeQuery(); rs = wrapResultSetIfEnabled( rs , session ); if ( !dialect.supportsLimitOffset() || !useLimit( selection, dialect ) ) { advance( rs, selection ); } if ( autodiscovertypes ) { autoDiscoverTypes( rs ); } return rs; } catch ( SQLException sqle ) { st.close(); throw sqle; } }
/** * Bind parameter values needed by the dialect-specific LIMIT clause. * * @param statement The statement to which to bind limit param values. * @param index The bind position from which to start binding * @param selection The selection object containing the limit information. * @return The number of parameter values bound. * @throws java.sql.SQLException Indicates problems binding parameter values. */ private int bindLimitParameters( final PreparedStatement statement, final int index, final RowSelection selection) throws SQLException { Dialect dialect = getFactory().getDialect(); if ( !dialect.supportsVariableLimit() ) { return 0; } if ( !hasMaxRows( selection ) ) { throw new AssertionFailure( "no max results set" ); } int firstRow = getFirstRow( selection ); int lastRow = getMaxOrLimit( selection, dialect ); boolean hasFirstRow = firstRow > 0 && dialect.supportsLimitOffset(); boolean reverse = dialect.bindLimitParametersInReverseOrder(); if ( hasFirstRow ) { statement.setInt( index + ( reverse ? 1 : 0 ), firstRow ); } statement.setInt( index + ( reverse || !hasFirstRow ? 0 : 1 ), lastRow ); return hasFirstRow ? 2 : 1; }
/** * Bind parameter values needed by the dialect-specific LIMIT clause. * * @param statement The statement to which to bind limit param values. * @param index The bind position from which to start binding * @param selection The selection object containing the limit information. * @return The number of parameter values bound. * @throws java.sql.SQLException Indicates problems binding parameter values. */ private int bindLimitParameters( final PreparedStatement statement, final int index, final RowSelection selection) throws SQLException { Dialect dialect = getFactory().getDialect(); if ( !dialect.supportsVariableLimit() ) { return 0; } if ( !hasMaxRows( selection ) ) { throw new AssertionFailure( "no max results set" ); } int firstRow = interpretFirstRow( getFirstRow( selection ) ); int lastRow = getMaxOrLimit( selection, dialect ); boolean hasFirstRow = dialect.supportsLimitOffset() && ( firstRow > 0 || dialect.forceLimitUsage() ); boolean reverse = dialect.bindLimitParametersInReverseOrder(); if ( hasFirstRow ) { statement.setInt( index + ( reverse ? 1 : 0 ), firstRow ); } statement.setInt( index + ( reverse || !hasFirstRow ? 0 : 1 ), lastRow ); return hasFirstRow ? 2 : 1; }
/** * Fetch a <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, * advance to the first result and return an SQL <tt>ResultSet</tt> */ protected final ResultSet getResultSet(final PreparedStatement st, final boolean callable, final RowSelection selection, final SessionImplementor session) throws SQLException, HibernateException { ResultSet rs = null; try { Dialect dialect = getFactory().getDialect(); if (callable) { rs = session.getBatcher().getResultSet( (CallableStatement) st, dialect ); } else { rs = session.getBatcher().getResultSet( st ); } rs = wrapResultSetIfEnabled( rs , session ); if ( !dialect.supportsLimitOffset() || !useLimit( selection, dialect ) ) { advance( rs, selection ); } return rs; } catch ( SQLException sqle ) { session.getBatcher().closeQueryStatement( st, rs ); throw sqle; } }