Package org.hibernate

Interface ScrollableResults<R>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void afterLast()
      Go to a location just after the last result.
      void beforeFirst()
      Go to a location just before first result, This is the location of the cursor on a newly returned scrollable result.
      void close()
      Release resources immediately.
      boolean first()
      Go to the first result.
      R get()
      Get the current row of results.
      int getRowNumber()
      Get the current position in the results.
      boolean isFirst()
      Is this the first result?
      boolean isLast()
      Is this the last result?
      boolean last()
      Go to the last result.
      boolean next()
      Advance to the next result.
      boolean position​(int position)
      Moves the result cursor to the specified position.
      boolean previous()
      Retreat to the previous result.
      boolean scroll​(int positions)
      Scroll the specified number of positions from the current position.
      boolean setRowNumber​(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, otherwise false
      • 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 position (positive number) or the last row (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