Package org.hibernate

Interface ScrollableResults<R>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      voidafterLast()
      Go to a location just after the last result.
      voidbeforeFirst()
      Go to a location just before first result.
      voidclose()
      Release resources immediately.
      booleanfirst()
      Go to the first result.
      Rget()
      Get the current row of results.
      intgetRowNumber()
      Get the current position in the results.
      booleanisFirst()
      Is this the first result?
      booleanisLast()
      Is this the last result?
      booleanlast()
      Go to the last result.
      booleannext()
      Advance to the next result.
      booleanposition​(int position)
      Moves the result cursor to the specified position.
      booleanprevious()
      Retreat to the previous result.
      booleanscroll​(int positions)
      Scroll the specified number of positions from the current position.
      voidsetFetchSize​(int fetchSize)
      Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.
      booleansetRowNumber​(int rowNumber)
      Set the current position in the result set.
    • Method Detail

      • get

        R get()
        Get the current row of results.
        Returns:
        The array of results
      • next

        boolean next()
        Advance to the next result.
        Returns:
        true if there is another result
      • previous

        boolean previous()
        Retreat to the previous result.
        Returns:
        true if there is a previous result
      • scroll

        boolean scroll​(int positions)
        Scroll the specified number of positions from the current position.
        Parameters:
        positions - a positive (forward) or negative (backward) number of rows
        Returns:
        true if there is a result at the new location
      • position

        boolean position​(int position)
        Moves the result cursor to the specified position.
        Returns:
        true if there is a result at the new location
      • last

        boolean last()
        Go to the last result.
        Returns:
        true if there are any results
      • first

        boolean first()
        Go to the first result.
        Returns:
        true if there are any results
      • beforeFirst

        void beforeFirst()
        Go to a location just before first result.

        This is the location of the cursor on a newly returned scrollable result.

      • afterLast

        void afterLast()
        Go to a location just after the last result.
      • isFirst

        boolean isFirst()
        Is this the first result?
        Returns:
        true if this is the first row of results, otherwisefalse
      • isLast

        boolean isLast()
        Is this the last result?
        Returns:
        true if this is the last row of results.
      • getRowNumber

        int getRowNumber()
        Get the current position in the results.

        The first position is number 0 (unlike JDBC).

        Returns:
        The current position number, numbered from 0; -1 indicates that there is no current row
      • setRowNumber

        boolean setRowNumber​(int rowNumber)
        Set the current position in the result set.

        Can be numbered from the first result (positive number) or backward from the last result (negative number).

        Parameters:
        rowNumber - the row number. A positive number indicates a value numbered from the first row; a negative number indicates a value numbered from the last row.
        Returns:
        true if there is a row at that row number
      • setFetchSize

        void setFetchSize​(int fetchSize)
        Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. If0, the JDBC driver's default setting will be used.
        Since:
        6.1.2
        See Also:
        ResultSet.setFetchSize(int),JdbcSettings.STATEMENT_FETCH_SIZE