org.hibernate.impl
Class AbstractScrollableResults

java.lang.Object
  extended by org.hibernate.impl.AbstractScrollableResults
All Implemented Interfaces:
ScrollableResults
Direct Known Subclasses:
FetchingScrollableResultsImpl, ScrollableResultsImpl

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

Implementation of the ScrollableResults interface

Author:
Steve Ebersole

Constructor Summary
AbstractScrollableResults(java.sql.ResultSet rs, java.sql.PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator)
           
 
Method Summary
protected  void afterScrollOperation()
           
 void close()
          Release resources immediately.
 java.lang.Object[] get()
          Get the current row of results
 java.lang.Object get(int col)
          Get the ith object in the current row of results, without initializing any other results in the row.
 java.math.BigDecimal getBigDecimal(int col)
          Convenience method to read a big_decimal
 java.math.BigInteger getBigInteger(int col)
          Convenience method to read a big_integer
 byte[] getBinary(int col)
          Convenience method to read a binary
 java.sql.Blob getBlob(int col)
          Convenience method to read a blob
 java.lang.Boolean getBoolean(int col)
          Convenience method to read a boolean
 java.lang.Byte getByte(int col)
          Convenience method to read a byte
 java.util.Calendar getCalendar(int col)
          Convenience method to read a calendar or calendar_date
 java.lang.Character getCharacter(int col)
          Convenience method to read a character
 java.sql.Clob getClob(int col)
          Convenience method to read a clob
protected abstract  java.lang.Object[] getCurrentRow()
           
 java.util.Date getDate(int col)
          Convenience method to read a date, time or timestamp
 java.lang.Double getDouble(int col)
          Convenience method to read a double
protected  java.lang.Object getFinal(int col, Type returnType)
          Check that the requested type is compatible with the result type, and return the column value.
 java.lang.Float getFloat(int col)
          Convenience method to read a float
protected  HolderInstantiator getHolderInstantiator()
           
 java.lang.Integer getInteger(int col)
          Convenience method to read an integer
protected  Loader getLoader()
           
 java.util.Locale getLocale(int col)
          Convenience method to read a locale
 java.lang.Long getLong(int col)
          Convenience method to read a long
protected  java.lang.Object getNonFinal(int col, Type returnType)
          Check that the requested type is compatible with the result type, and return the column value.
protected  java.sql.PreparedStatement getPs()
           
protected  QueryParameters getQueryParameters()
           
protected  java.sql.ResultSet getResultSet()
           
protected  SessionImplementor getSession()
           
 java.lang.Short getShort(int col)
          Convenience method to read a short
 java.lang.String getString(int col)
          Convenience method to read a string
 java.lang.String getText(int col)
          Convenience method to read text
 java.util.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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.ScrollableResults
afterLast, beforeFirst, first, getRowNumber, isFirst, isLast, last, next, previous, scroll, setRowNumber
 

Constructor Detail

AbstractScrollableResults

public AbstractScrollableResults(java.sql.ResultSet rs,
                                 java.sql.PreparedStatement ps,
                                 SessionImplementor sess,
                                 Loader loader,
                                 QueryParameters queryParameters,
                                 Type[] types,
                                 HolderInstantiator holderInstantiator)
                          throws MappingException
Throws:
MappingException
Method Detail

getCurrentRow

protected abstract java.lang.Object[] getCurrentRow()

getResultSet

protected java.sql.ResultSet getResultSet()

getPs

protected java.sql.PreparedStatement getPs()

getSession

protected SessionImplementor getSession()

getLoader

protected Loader getLoader()

getQueryParameters

protected QueryParameters getQueryParameters()

getTypes

protected Type[] getTypes()

getHolderInstantiator

protected HolderInstantiator getHolderInstantiator()

close

public final void close()
                 throws HibernateException
Description copied from interface: ScrollableResults
Release resources immediately.

Specified by:
close in interface ScrollableResults
Throws:
HibernateException

get

public final java.lang.Object[] get()
                             throws HibernateException
Description copied from interface: ScrollableResults
Get the current row of results

Specified by:
get in interface ScrollableResults
Returns:
an object or array
Throws:
HibernateException

get

public final java.lang.Object get(int col)
                           throws HibernateException
Description copied from interface: ScrollableResults
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:
col - the column, numbered from zero
Returns:
an object of any Hibernate type or null
Throws:
HibernateException

getFinal

protected final java.lang.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
Throws:
HibernateException

getNonFinal

protected final java.lang.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
Throws:
HibernateException

getBigDecimal

public final java.math.BigDecimal getBigDecimal(int col)
                                         throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a big_decimal

Specified by:
getBigDecimal in interface ScrollableResults
Throws:
HibernateException

getBigInteger

public final java.math.BigInteger getBigInteger(int col)
                                         throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a big_integer

Specified by:
getBigInteger in interface ScrollableResults
Throws:
HibernateException

getBinary

public final byte[] getBinary(int col)
                       throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a binary

Specified by:
getBinary in interface ScrollableResults
Throws:
HibernateException

getText

public final java.lang.String getText(int col)
                               throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read text

Specified by:
getText in interface ScrollableResults
Throws:
HibernateException

getBlob

public final java.sql.Blob getBlob(int col)
                            throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a blob

Specified by:
getBlob in interface ScrollableResults
Throws:
HibernateException

getClob

public final java.sql.Clob getClob(int col)
                            throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a clob

Specified by:
getClob in interface ScrollableResults
Throws:
HibernateException

getBoolean

public final java.lang.Boolean getBoolean(int col)
                                   throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a boolean

Specified by:
getBoolean in interface ScrollableResults
Throws:
HibernateException

getByte

public final java.lang.Byte getByte(int col)
                             throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a byte

Specified by:
getByte in interface ScrollableResults
Throws:
HibernateException

getCharacter

public final java.lang.Character getCharacter(int col)
                                       throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a character

Specified by:
getCharacter in interface ScrollableResults
Throws:
HibernateException

getDate

public final java.util.Date getDate(int col)
                             throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a date, time or timestamp

Specified by:
getDate in interface ScrollableResults
Throws:
HibernateException

getCalendar

public final java.util.Calendar getCalendar(int col)
                                     throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a calendar or calendar_date

Specified by:
getCalendar in interface ScrollableResults
Throws:
HibernateException

getDouble

public final java.lang.Double getDouble(int col)
                                 throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a double

Specified by:
getDouble in interface ScrollableResults
Throws:
HibernateException

getFloat

public final java.lang.Float getFloat(int col)
                               throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a float

Specified by:
getFloat in interface ScrollableResults
Throws:
HibernateException

getInteger

public final java.lang.Integer getInteger(int col)
                                   throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read an integer

Specified by:
getInteger in interface ScrollableResults
Throws:
HibernateException

getLong

public final java.lang.Long getLong(int col)
                             throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a long

Specified by:
getLong in interface ScrollableResults
Throws:
HibernateException

getShort

public final java.lang.Short getShort(int col)
                               throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a short

Specified by:
getShort in interface ScrollableResults
Throws:
HibernateException

getString

public final java.lang.String getString(int col)
                                 throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a string

Specified by:
getString in interface ScrollableResults
Throws:
HibernateException

getLocale

public final java.util.Locale getLocale(int col)
                                 throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a locale

Specified by:
getLocale in interface ScrollableResults
Throws:
HibernateException

getTimeZone

public final java.util.TimeZone getTimeZone(int col)
                                     throws HibernateException
Description copied from interface: ScrollableResults
Convenience method to read a timezone

Specified by:
getTimeZone in interface ScrollableResults
Throws:
HibernateException

getType

public final Type getType(int i)
Description copied from interface: ScrollableResults
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

afterScrollOperation

protected void afterScrollOperation()


Copyright © 2008 Hibernate.org. All Rights Reserved.