/** * Go to the first result * * @return <tt>true</tt> if there are any results */ public boolean first() throws HibernateException { beforeFirst(); boolean more = next(); afterScrollOperation(); return more; }
/** * Go to a location just after the last result */ public void afterLast() throws HibernateException { // TODO : not sure the best way to handle this. // The non-performant way : last(); next(); afterScrollOperation(); }
/** * Retreat to the previous result * * @return <tt>true</tt> if there is a previous result */ public boolean previous() throws HibernateException { if ( currentPosition <= 1 ) { currentPosition = 0; currentRow = null; return false; } Object loadResult = getLoader().loadSequentialRowsReverse( getResultSet(), getSession(), getQueryParameters(), false, ( maxPosition != null && currentPosition > maxPosition.intValue() ) ); currentRow = new Object[] { loadResult }; currentPosition--; afterScrollOperation(); return true; }