/** * 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; } }
/** * 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; } }
/** * 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; } }
final Dialect dialect = getFactory().getDialect(); final RowSelection selection = queryParameters.getRowSelection(); boolean useLimit = useLimit( selection, dialect ); boolean hasFirstRow = getFirstRow( selection ) > 0; boolean useOffset = hasFirstRow && useLimit && dialect.supportsLimitOffset();
final Dialect dialect = getFactory().getDialect(); final RowSelection selection = queryParameters.getRowSelection(); boolean useLimit = useLimit( selection, dialect ); boolean hasFirstRow = getFirstRow( selection ) > 0; boolean useLimitOffset = hasFirstRow && useLimit && dialect.supportsLimitOffset();
final Dialect dialect = getFactory().getDialect(); final RowSelection selection = queryParameters.getRowSelection(); boolean useLimit = useLimit( selection, dialect ); boolean hasFirstRow = getFirstRow( selection ) > 0; boolean useLimitOffset = hasFirstRow && useLimit && dialect.supportsLimitOffset();