FileDocCategorySizeDatePackage
ScrollableResults.javaAPI DocHibernate 3.2.56253Wed Apr 13 02:37:50 BST 2005org.hibernate

ScrollableResults

public interface ScrollableResults
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
Query#scroll()
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
public voidafterLast()
Go to a location just after the last result

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

public voidclose()
Release resources immediately.

public booleanfirst()
Go to the first result

return
true if there are any results

public java.lang.Object[]get()
Get the current row of results

return
an object or array

public java.lang.Objectget(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).

param
i the column, numbered from zero
return
an object of any Hibernate type or null

public java.math.BigDecimalgetBigDecimal(int col)
Convenience method to read a big_decimal

public java.math.BigIntegergetBigInteger(int col)
Convenience method to read a big_integer

public byte[]getBinary(int col)
Convenience method to read a binary

public java.sql.BlobgetBlob(int col)
Convenience method to read a blob

public java.lang.BooleangetBoolean(int col)
Convenience method to read a boolean

public java.lang.BytegetByte(int col)
Convenience method to read a byte

public java.util.CalendargetCalendar(int col)
Convenience method to read a calendar or calendar_date

public java.lang.CharactergetCharacter(int col)
Convenience method to read a character

public java.sql.ClobgetClob(int col)
Convenience method to read a clob

public java.util.DategetDate(int col)
Convenience method to read a date, time or timestamp

public java.lang.DoublegetDouble(int col)
Convenience method to read a double

public java.lang.FloatgetFloat(int col)
Convenience method to read a float

public java.lang.IntegergetInteger(int col)
Convenience method to read an integer

public java.util.LocalegetLocale(int col)
Convenience method to read a locale

public java.lang.LonggetLong(int col)
Convenience method to read a long

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

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

public java.lang.ShortgetShort(int col)
Convenience method to read a short

public java.lang.StringgetString(int col)
Convenience method to read a string

public java.lang.StringgetText(int col)
Convenience method to read text

public java.util.TimeZonegetTimeZone(int col)
Convenience method to read a timezone

public org.hibernate.type.TypegetType(int i)
Get the type of the ith column of results

param
i the column, numbered from zero
return
the Hibernate type

public booleanisFirst()
Is this the first result?

return
true if this is the first row of results
throws
HibernateException

public booleanisLast()
Is this the last result?

return
true if this is the last row of results
throws
HibernateException

public booleanlast()
Go to the last result

return
true if there are any results

public booleannext()
Advance to the next result

return
true if there is another result

public booleanprevious()
Retreat to the previous result

return
true if there is a previous result

public booleanscroll(int i)
Scroll an arbitrary number of locations

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

public booleansetRowNumber(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).

param
rowNumber the row number, numbered from the last row, in the case of a negative row number
return
true if there is a row at that row number