站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

ScrollableResultsImpl (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.impl
Class ScrollableResultsImpl

java.lang.Object
  extended bynet.sf.hibernate.impl.ScrollableResultsImpl
All Implemented Interfaces:
ScrollableResults

public class ScrollableResultsImpl
extends Object
implements ScrollableResults

Implementation of the ScrollableResults interface

Author:
Gavin King

Constructor Summary
ScrollableResultsImpl(ResultSet rs, PreparedStatement ps, SessionImplementor sess, QueryTranslator queryTranslator, QueryParameters queryParameters, Type[] types, Class holderClass)
           
 
Method Summary
 void afterLast()
          Go to a location just after the last result
 void beforeFirst()
          Go to a location just before first result (this is the initial location)
 void close()
          Release resources immediately.
protected  JDBCException convert(SQLException sqlException, String message)
           
 boolean first()
          Go to the first result
 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
 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
 Date getDate(int col)
          Convenience method to read a date, time or timestamp
 Double getDouble(int col)
          Convenience method to read a double
 Float getFloat(int col)
          Convenience method to read a float
 Integer getInteger(int col)
          Convenience method to read an integer
 Locale getLocale(int col)
          Convenience method to read a locale
 Long getLong(int col)
          Convenience method to read a long
 int getRowNumber()
          Get the current location in the result set.
 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
 boolean isFirst()
          Is this the first result?
 boolean isLast()
          Is this the last result?
 boolean last()
          Go to the last result
 boolean next()
          Advance to the next result
 boolean previous()
          Retreat to the previous result
 boolean scroll(int i)
          Scroll an arbitrary number of locations
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScrollableResultsImpl

public ScrollableResultsImpl(ResultSet rs,
                             PreparedStatement ps,
                             SessionImplementor sess,
                             QueryTranslator queryTranslator,
                             QueryParameters queryParameters,
                             Type[] types,
                             Class holderClass)
                      throws MappingException
Method Detail

scroll

public boolean scroll(int i)
               throws HibernateException
Description copied from interface: ScrollableResults
Scroll an arbitrary number of locations

Specified by:
scroll in interface ScrollableResults
Parameters:
i - a positive (forward) or negative (backward) number of rows
Returns:
true if there is a result at the new location
Throws:
HibernateException
See Also:
ScrollableResults.scroll(int)

first

public boolean first()
              throws HibernateException
Description copied from interface: ScrollableResults
Go to the first result

Specified by:
first in interface ScrollableResults
Returns:
true if there are any results
Throws:
HibernateException
See Also:
ScrollableResults.first()

last

public boolean last()
             throws HibernateException
Description copied from interface: ScrollableResults
Go to the last result

Specified by:
last in interface ScrollableResults
Returns:
true if there are any results
Throws:
HibernateException
See Also:
ScrollableResults.last()

next

public boolean next()
             throws HibernateException
Description copied from interface: ScrollableResults
Advance to the next result

Specified by:
next in interface ScrollableResults
Returns:
true if there is another result
Throws:
HibernateException
See Also:
ScrollableResults.next()

previous

public boolean previous()
                 throws HibernateException
Description copied from interface: ScrollableResults
Retreat to the previous result

Specified by:
previous in interface ScrollableResults
Returns:
true if there is a previous result
Throws:
HibernateException
See Also:
ScrollableResults.previous()

get

public 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
See Also:
ScrollableResults.get()

get

public 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
See Also:
ScrollableResults.get(int)

getBigDecimal

public 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
See Also:
ScrollableResults.getBigDecimal(int)

getBinary

public 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
See Also:
ScrollableResults.getBinary(int)

getText

public 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 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
See Also:
ScrollableResults.getBlob(int)

getClob

public 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
See Also:
ScrollableResults.getClob(int)

getBoolean

public 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
See Also:
ScrollableResults.getBoolean(int)

getByte

public 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
See Also:
ScrollableResults.getByte(int)

getCharacter

public 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
See Also:
ScrollableResults.getCharacter(int)

getDate

public 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
See Also:
ScrollableResults.getDate(int)

getCalendar

public 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 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
See Also:
ScrollableResults.getDouble(int)

getFloat

public 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
See Also:
ScrollableResults.getFloat(int)

getInteger

public 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
See Also:
ScrollableResults.getInteger(int)

getLong

public 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
See Also:
ScrollableResults.getLong(int)

getShort

public 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
See Also:
ScrollableResults.getShort(int)

getString

public 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
See Also:
ScrollableResults.getString(int)

afterLast

public void afterLast()
               throws HibernateException
Description copied from interface: ScrollableResults
Go to a location just after the last result

Specified by:
afterLast in interface ScrollableResults
Throws:
HibernateException
See Also:
ScrollableResults.afterLast()

beforeFirst

public void beforeFirst()
                 throws HibernateException
Description copied from interface: ScrollableResults
Go to a location just before first result (this is the initial location)

Specified by:
beforeFirst in interface ScrollableResults
Throws:
HibernateException
See Also:
ScrollableResults.beforeFirst()

close

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

Specified by:
close in interface ScrollableResults
Throws:
HibernateException
See Also:
ScrollableResults.close()

getLocale

public 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
See Also:
ScrollableResults.getLocale(int)

getTimeZone

public 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
See Also:
ScrollableResults.getTimeZone(int)

getType

public 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
See Also:
ScrollableResults.getType(int)

isFirst

public boolean isFirst()
                throws HibernateException
Description copied from interface: ScrollableResults
Is this the first result?

Specified by:
isFirst in interface ScrollableResults
Returns:
true if this is the first row of results
Throws:
HibernateException
See Also:
ScrollableResults.isFirst()

isLast

public boolean isLast()
               throws HibernateException
Description copied from interface: ScrollableResults
Is this the last result?

Specified by:
isLast in interface ScrollableResults
Returns:
true if this is the last row of results
Throws:
HibernateException
See Also:
ScrollableResults.isLast()

getRowNumber

public int getRowNumber()
                 throws HibernateException
Description copied from interface: ScrollableResults
Get the current location in the result set. The first row is number 0, contrary to JDBC.

Specified by:
getRowNumber in interface ScrollableResults
Returns:
the row number, numbered from 0, or -1 if there is no current row
Throws:
HibernateException

setRowNumber

public boolean setRowNumber(int rowNumber)
                     throws HibernateException
Description copied from interface: ScrollableResults
Set the current location in the result set, numbered from either the first row (row number 0), or the last row (row number -1).

Specified by:
setRowNumber in interface ScrollableResults
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
Throws:
HibernateException

convert

protected JDBCException convert(SQLException sqlException,
                                String message)