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.
afterLast
public void afterLast()
throws HibernateException
Go to a location just after the last result
beforeFirst
public void beforeFirst()
throws HibernateException
Go to a location just before first result (this is the initial location)
first
public boolean first()
throws HibernateException
Go to the first result
- true if there are any results
get
public Object get(int i)
throws HibernateException
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).
i
- the column, numbered from zero
- an object of any Hibernate type or null
getBigDecimal
public BigDecimal getBigDecimal(int col)
throws HibernateException
Convenience method to read a big_decimal
getBigInteger
public BigInteger getBigInteger(int col)
throws HibernateException
Convenience method to read a big_integer
getBinary
public byte[] getBinary(int col)
throws HibernateException
Convenience method to read a binary
getBlob
public Blob getBlob(int col)
throws HibernateException
Convenience method to read a blob
getBoolean
public Boolean getBoolean(int col)
throws HibernateException
Convenience method to read a boolean
getByte
public Byte getByte(int col)
throws HibernateException
Convenience method to read a byte
getCalendar
public Calendar getCalendar(int col)
throws HibernateException
Convenience method to read a calendar or calendar_date
getCharacter
public Character getCharacter(int col)
throws HibernateException
Convenience method to read a character
getClob
public Clob getClob(int col)
throws HibernateException
Convenience method to read a clob
getDate
public Date getDate(int col)
throws HibernateException
Convenience method to read a date, time or timestamp
getDouble
public Double getDouble(int col)
throws HibernateException
Convenience method to read a double
getFloat
public Float getFloat(int col)
throws HibernateException
Convenience method to read a float
getInteger
public Integer getInteger(int col)
throws HibernateException
Convenience method to read an integer
getLocale
public Locale getLocale(int col)
throws HibernateException
Convenience method to read a locale
getLong
public Long getLong(int col)
throws HibernateException
Convenience method to read a long
getRowNumber
public int getRowNumber()
throws HibernateException
Get the current location in the result set. The first
row is number 0, contrary to JDBC.
- the row number, numbered from 0, or -1 if
there is no current row
getShort
public Short getShort(int col)
throws HibernateException
Convenience method to read a short
getString
public String getString(int col)
throws HibernateException
Convenience method to read a string
getText
public String getText(int col)
throws HibernateException
Convenience method to read text
getTimeZone
public TimeZone getTimeZone(int col)
throws HibernateException
Convenience method to read a timezone
getType
public Type getType(int i)
Get the type of the ith column of results
i
- the column, numbered from zero
isFirst
public boolean isFirst()
throws HibernateException
Is this the first result?
- true if this is the first row of results
isLast
public boolean isLast()
throws HibernateException
Is this the last result?
- true if this is the last row of results
last
public boolean last()
throws HibernateException
Go to the last result
- true if there are any results
next
public boolean next()
throws HibernateException
Advance to the next result
- true if there is another result
previous
public boolean previous()
throws HibernateException
Retreat to the previous result
- true if there is a previous result
scroll
public boolean scroll(int i)
throws HibernateException
Scroll an arbitrary number of locations
i
- a positive (forward) or negative (backward) number of rows
- true if there is a result at the new location
setRowNumber
public boolean setRowNumber(int rowNumber)
throws HibernateException
Set the current location in the result set, numbered from either the
first row (row number 0), or the last row (row
number -1).
rowNumber
- the row number, numbered from the last row, in the
case of a negative row number
- true if there is a row at that row number