org.hibernate.impl

Class AbstractScrollableResults

Implemented Interfaces:
ScrollableResults
Known Direct Subclasses:
FetchingScrollableResultsImpl, ScrollableResultsImpl

public abstract class AbstractScrollableResults
extends java.lang.Object
implements ScrollableResults

Implementation of the ScrollableResults interface
Author:
Steve Ebersole

Constructor Summary

AbstractScrollableResults(ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator)

Method Summary

protected void
afterScrollOperation()
void
close()
Release resources immediately.
Object[]
get()
Get the current row of results
Object
get(int col)
Get the ith object in the current row of results, without initializing any other results in the row.
BigDecimal
getBigDecimal(int col)
Convenience method to read a big_decimal
BigInteger
getBigInteger(int col)
Convenience method to read a big_integer
byte[]
getBinary(int col)
Convenience method to read a binary
Blob
getBlob(int col)
Convenience method to read a blob
Boolean
getBoolean(int col)
Convenience method to read a boolean
Byte
getByte(int col)
Convenience method to read a byte
Calendar
getCalendar(int col)
Convenience method to read a calendar or calendar_date
Character
getCharacter(int col)
Convenience method to read a character
Clob
getClob(int col)
Convenience method to read a clob
protected abstract Object[]
getCurrentRow()
Date
getDate(int col)
Convenience method to read a date, time or timestamp
Double
getDouble(int col)
Convenience method to read a double
protected Object
getFinal(int col, Type returnType)
Check that the requested type is compatible with the result type, and return the column value.
Float
getFloat(int col)
Convenience method to read a float
protected HolderInstantiator
getHolderInstantiator()
Integer
getInteger(int col)
Convenience method to read an integer
protected Loader
getLoader()
Locale
getLocale(int col)
Convenience method to read a locale
Long
getLong(int col)
Convenience method to read a long
protected Object
getNonFinal(int col, Type returnType)
Check that the requested type is compatible with the result type, and return the column value.
protected PreparedStatement
getPs()
protected QueryParameters
getQueryParameters()
protected ResultSet
getResultSet()
protected SessionImplementor
getSession()
Short
getShort(int col)
Convenience method to read a short
String
getString(int col)
Convenience method to read a string
String
getText(int col)
Convenience method to read text
TimeZone
getTimeZone(int col)
Convenience method to read a timezone
Type
getType(int i)
Get the type of the ith column of results
protected Type[]
getTypes()

Constructor Details

AbstractScrollableResults

public AbstractScrollableResults(ResultSet rs,
                                 PreparedStatement ps,
                                 SessionImplementor sess,
                                 Loader loader,
                                 QueryParameters queryParameters,
                                 Type[] types,
                                 HolderInstantiator holderInstantiator)
            throws MappingException

Method Details

afterScrollOperation

protected void afterScrollOperation()

close

public final void close()
            throws HibernateException
Release resources immediately.
Specified by:
close in interface ScrollableResults

get

public final Object[] get()
            throws HibernateException
Get the current row of results
Specified by:
get in interface ScrollableResults
Returns:
an object or array

get

public final Object get(int col)
            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).
Specified by:
get in interface ScrollableResults
Parameters:
Returns:
an object of any Hibernate type or null

getBigDecimal

public final BigDecimal getBigDecimal(int col)
            throws HibernateException
Convenience method to read a big_decimal
Specified by:
getBigDecimal in interface ScrollableResults

getBigInteger

public final BigInteger getBigInteger(int col)
            throws HibernateException
Convenience method to read a big_integer
Specified by:
getBigInteger in interface ScrollableResults

getBinary

public final byte[] getBinary(int col)
            throws HibernateException
Convenience method to read a binary
Specified by:
getBinary in interface ScrollableResults

getBlob

public final Blob getBlob(int col)
            throws HibernateException
Convenience method to read a blob
Specified by:
getBlob in interface ScrollableResults

getBoolean

public final Boolean getBoolean(int col)
            throws HibernateException
Convenience method to read a boolean
Specified by:
getBoolean in interface ScrollableResults

getByte

public final Byte getByte(int col)
            throws HibernateException
Convenience method to read a byte
Specified by:
getByte in interface ScrollableResults

getCalendar

public final Calendar getCalendar(int col)
            throws HibernateException
Convenience method to read a calendar or calendar_date
Specified by:
getCalendar in interface ScrollableResults

getCharacter

public final Character getCharacter(int col)
            throws HibernateException
Convenience method to read a character
Specified by:
getCharacter in interface ScrollableResults

getClob

public final Clob getClob(int col)
            throws HibernateException
Convenience method to read a clob
Specified by:
getClob in interface ScrollableResults

getCurrentRow

protected abstract Object[] getCurrentRow()

getDate

public final Date getDate(int col)
            throws HibernateException
Convenience method to read a date, time or timestamp
Specified by:
getDate in interface ScrollableResults

getDouble

public final Double getDouble(int col)
            throws HibernateException
Convenience method to read a double
Specified by:
getDouble in interface ScrollableResults

getFinal

protected final Object getFinal(int col,
                                Type returnType)
            throws HibernateException
Check that the requested type is compatible with the result type, and return the column value. This version makes sure the the classes are identical.
Parameters:
col - the column
returnType - a "final" type

getFloat

public final Float getFloat(int col)
            throws HibernateException
Convenience method to read a float
Specified by:
getFloat in interface ScrollableResults

getHolderInstantiator

protected HolderInstantiator getHolderInstantiator()

getInteger

public final Integer getInteger(int col)
            throws HibernateException
Convenience method to read an integer
Specified by:
getInteger in interface ScrollableResults

getLoader

protected Loader getLoader()

getLocale

public final Locale getLocale(int col)
            throws HibernateException
Convenience method to read a locale
Specified by:
getLocale in interface ScrollableResults

getLong

public final Long getLong(int col)
            throws HibernateException
Convenience method to read a long
Specified by:
getLong in interface ScrollableResults

getNonFinal

protected final Object getNonFinal(int col,
                                   Type returnType)
            throws HibernateException
Check that the requested type is compatible with the result type, and return the column value. This version makes sure the the classes are "assignable".
Parameters:
col - the column
returnType - any type

getPs

protected PreparedStatement getPs()

getQueryParameters

protected QueryParameters getQueryParameters()

getResultSet

protected ResultSet getResultSet()

getSession

protected SessionImplementor getSession()

getShort

public final Short getShort(int col)
            throws HibernateException
Convenience method to read a short
Specified by:
getShort in interface ScrollableResults

getString

public final String getString(int col)
            throws HibernateException
Convenience method to read a string
Specified by:
getString in interface ScrollableResults

getText

public final String getText(int col)
            throws HibernateException
Convenience method to read text
Specified by:
getText in interface ScrollableResults

getTimeZone

public final TimeZone getTimeZone(int col)
            throws HibernateException
Convenience method to read a timezone
Specified by:
getTimeZone in interface ScrollableResults

getType

public final Type getType(int i)
Get the type of the ith column of results
Specified by:
getType in interface ScrollableResults
Parameters:
i - the column, numbered from zero
Returns:
the Hibernate type

getTypes

protected Type[] getTypes()