public interface

ScrollableResults

org.hibernate.ScrollableResults
Known Indirect Subclasses

Class Overview

A result iterator that allows moving around within the results by arbitrary increments. The Query / ScrollableResults pattern is very similar to the JDBC PreparedStatement/ ResultSet pattern and the semantics of methods of this interface are similar to the similarly named methods on ResultSet.

Contrary to JDBC, columns of results are numbered from zero.

See Also

Summary

Public Methods
abstract void afterLast()
Go to a location just after the last result
abstract void beforeFirst()
Go to a location just before first result (this is the initial location)
abstract void close()
Release resources immediately.
abstract boolean first()
Go to the first result
abstract Object[] get()
Get the current row of results
abstract Object get(int i)
Get the ith object in the current row of results, without initializing any other results in the row.
abstract BigDecimal getBigDecimal(int col)
Convenience method to read a big_decimal
abstract BigInteger getBigInteger(int col)
Convenience method to read a big_integer
abstract byte[] getBinary(int col)
Convenience method to read a binary
abstract Blob getBlob(int col)
Convenience method to read a blob
abstract Boolean getBoolean(int col)
Convenience method to read a boolean
abstract Byte getByte(int col)
Convenience method to read a byte
abstract Calendar getCalendar(int col)
Convenience method to read a calendar or calendar_date
abstract Character getCharacter(int col)
Convenience method to read a character
abstract Clob getClob(int col)
Convenience method to read a clob
abstract Date getDate(int col)
Convenience method to read a date, time or timestamp
abstract Double getDouble(int col)
Convenience method to read a double
abstract Float getFloat(int col)
Convenience method to read a float
abstract Integer getInteger(int col)
Convenience method to read an integer
abstract Locale getLocale(int col)
Convenience method to read a locale
abstract Long getLong(int col)
Convenience method to read a long
abstract int getRowNumber()
Get the current location in the result set.
abstract Short getShort(int col)
Convenience method to read a short
abstract String getString(int col)
Convenience method to read a string
abstract String getText(int col)
Convenience method to read text
abstract TimeZone getTimeZone(int col)
Convenience method to read a timezone
abstract Type getType(int i)
Get the type of the ith column of results
abstract boolean isFirst()
Is this the first result?
abstract boolean isLast()
Is this the last result?
abstract boolean last()
Go to the last result
abstract boolean next()
Advance to the next result
abstract boolean previous()
Retreat to the previous result
abstract boolean scroll(int i)
Scroll an arbitrary number of locations
abstract boolean setRowNumber(int rowNumber)
Set the current location in the result set, numbered from either the first row (row number 0), or the last row (row number -1).

Public Methods

public abstract void afterLast ()

Go to a location just after the last result

public abstract void beforeFirst ()

Go to a location just before first result (this is the initial location)

public abstract void close ()

Release resources immediately.

public abstract boolean first ()

Go to the first result

Returns
  • true if there are any results

public abstract Object[] get ()

Get the current row of results

Returns
  • an object or array

public abstract Object get (int i)

Get the ith object in the current row of results, without initializing any other results in the row. This method may be used safely, regardless of the type of the column (ie. even for scalar results).

Parameters
i the column, numbered from zero
Returns
  • an object of any Hibernate type or null

public abstract BigDecimal getBigDecimal (int col)

Convenience method to read a big_decimal

public abstract BigInteger getBigInteger (int col)

Convenience method to read a big_integer

public abstract byte[] getBinary (int col)

Convenience method to read a binary

public abstract Blob getBlob (int col)

Convenience method to read a blob

public abstract Boolean getBoolean (int col)

Convenience method to read a boolean

public abstract Byte getByte (int col)

Convenience method to read a byte

public abstract Calendar getCalendar (int col)

Convenience method to read a calendar or calendar_date

public abstract Character getCharacter (int col)

Convenience method to read a character

public abstract Clob getClob (int col)

Convenience method to read a clob

public abstract Date getDate (int col)

Convenience method to read a date, time or timestamp

public abstract Double getDouble (int col)

Convenience method to read a double

public abstract Float getFloat (int col)

Convenience method to read a float

public abstract Integer getInteger (int col)

Convenience method to read an integer

public abstract Locale getLocale (int col)

Convenience method to read a locale

public abstract Long getLong (int col)

Convenience method to read a long

public abstract int getRowNumber ()

Get the current location in the result set. The first row is number 0, contrary to JDBC.

Returns
  • the row number, numbered from 0, or -1 if there is no current row

public abstract Short getShort (int col)

Convenience method to read a short

public abstract String getString (int col)

Convenience method to read a string

public abstract String getText (int col)

Convenience method to read text

public abstract TimeZone getTimeZone (int col)

Convenience method to read a timezone

public abstract Type getType (int i)

Get the type of the ith column of results

Parameters
i the column, numbered from zero
Returns
  • the Hibernate type

public abstract boolean isFirst ()

Is this the first result?

Returns
  • true if this is the first row of results

public abstract boolean isLast ()

Is this the last result?

Returns
  • true if this is the last row of results

public abstract boolean last ()

Go to the last result

Returns
  • true if there are any results

public abstract boolean next ()

Advance to the next result

Returns
  • true if there is another result

public abstract boolean previous ()

Retreat to the previous result

Returns
  • true if there is a previous result

public abstract boolean scroll (int i)

Scroll an arbitrary number of locations

Parameters
i a positive (forward) or negative (backward) number of rows
Returns
  • true if there is a result at the new location

public abstract boolean setRowNumber (int rowNumber)

Set the current location in the result set, numbered from either the first row (row number 0), or the last row (row number -1).

Parameters
rowNumber the row number, numbered from the last row, in the case of a negative row number
Returns
  • true if there is a row at that row number