Top Description Fields Constructors Methods
org.hibernate.internal

public Class ScrollableResultsImpl

extends AbstractScrollableResults
implements ScrollableResults
Class Inheritance
All Implemented Interfaces
org.hibernate.ScrollableResults, java.io.Closeable, java.lang.AutoCloseable
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, org.hibernate.HibernateException, .JDBCException, .ScrollableResults, org.hibernate.engine.spi.PersistenceContext, .QueryParameters, .SharedSessionContractImplementor, org.hibernate.hql.internal.HolderInstantiator, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.loader.Loader, org.hibernate.type.Type

Standard ScrollableResults implementation.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private Object[]

Constructor Summary

AccessConstructor and Description
public
ScrollableResultsImpl(ResultSet
The scrollable result set
rs
,
PreparedStatement
The prepared statement used to obtain the result set
ps
,
SharedSessionContractImplementor
The originating session
sess
,
Loader
The loader
loader
,
QueryParameters
query parameters
queryParameters
,
Type[]
The result types
types
,
HolderInstantiator
Ugh
holderInstantiator
)

Constructs a ScrollableResultsImpl using the specified information.

Method Summary

Modifier and TypeMethod and Description
public void
afterLast()

Implements org.hibernate.ScrollableResults.afterLast.

Go to a location just after the last result.
public void
beforeFirst()

Implements org.hibernate.ScrollableResults.beforeFirst.

Go to a location just before first result, This is the location of the cursor on a newly returned scrollable result.
protected JDBCException
convert(SQLException sqle, String message)

public boolean
first()

Implements org.hibernate.ScrollableResults.first.

Go to the first result.
protected Object[]
public int
getRowNumber()

Implements org.hibernate.ScrollableResults.getRowNumber.

Get the current position in the results.
public boolean
isFirst()

Implements org.hibernate.ScrollableResults.isFirst.

Is this the first result?
public boolean
isLast()

Implements org.hibernate.ScrollableResults.isLast.

Is this the last result?
public boolean
last()

Implements org.hibernate.ScrollableResults.last.

Go to the last result.
public boolean
next()

Implements org.hibernate.ScrollableResults.next.

Advance to the next result.
private void
prepareCurrentRow(boolean underlyingScrollSuccessful)

public boolean
previous()

Implements org.hibernate.ScrollableResults.previous.

Retreat to the previous result.
public boolean
scroll(int
a positive (forward) or negative (backward) number of rows
i
)

Implements org.hibernate.ScrollableResults.scroll.

Scroll the specified number of positions from the current position.
public boolean
setRowNumber(int
the row number. A positive number indicates a value numbered from the first row; a negative number indicates a value numbered from the last row.
rowNumber
)

Implements org.hibernate.ScrollableResults.setRowNumber.

Set the current position in the result set.
Inherited from org.hibernate.internal.AbstractScrollableResults:
afterScrollOperationclosegetgetgetBigDecimalgetBigIntegergetBinarygetBlobgetBooleangetBytegetCalendargetCharactergetClobgetDategetDoublegetFinalgetFloatgetHolderInstantiatorgetIntegergetLoadergetLocalegetLonggetNonFinalgetNumberOfTypesgetPsgetQueryParametersgetResultSetgetSessiongetShortgetStringgetTextgetTimeZonegetTypegetTypesisClosed

Field Detail

currentRowback to summary
private Object[] currentRow

Constructor Detail

ScrollableResultsImplback to summary
public ScrollableResultsImpl(ResultSet rs, PreparedStatement ps, SharedSessionContractImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator)

Constructs a ScrollableResultsImpl using the specified information.

Parameters
rs:ResultSet

The scrollable result set

ps:PreparedStatement

The prepared statement used to obtain the result set

sess:SharedSessionContractImplementor

The originating session

loader:Loader

The loader

queryParameters:QueryParameters

query parameters

types:Type[]

The result types

holderInstantiator:HolderInstantiator

Ugh

Method Detail

afterLastback to summary
public void afterLast()

Implements org.hibernate.ScrollableResults.afterLast.

Doc from org.hibernate.ScrollableResults.afterLast.

Go to a location just after the last result.

Annotations
@Override
beforeFirstback to summary
public void beforeFirst()

Implements org.hibernate.ScrollableResults.beforeFirst.

Doc from org.hibernate.ScrollableResults.beforeFirst.

Go to a location just before first result, This is the location of the cursor on a newly returned scrollable result.

Annotations
@Override
convertback to summary
protected JDBCException convert(SQLException sqle, String message)
firstback to summary
public boolean first()

Implements org.hibernate.ScrollableResults.first.

Doc from org.hibernate.ScrollableResults.first.

Go to the first result.

Returns:boolean

true if there are any results

Annotations
@Override
getCurrentRowback to summary
protected Object[] getCurrentRow()

Implements abstract org.hibernate.internal.AbstractScrollableResults.getCurrentRow.

Annotations
@Override
getRowNumberback to summary
public int getRowNumber() throws HibernateException

Implements org.hibernate.ScrollableResults.getRowNumber.

Doc from org.hibernate.ScrollableResults.getRowNumber.

Get the current position in the results. The first position is number 0 (unlike JDBC).

Returns:int

The current position number, numbered from 0; -1 indicates that there is no current row

Annotations
@Override
isFirstback to summary
public boolean isFirst()

Implements org.hibernate.ScrollableResults.isFirst.

Doc from org.hibernate.ScrollableResults.isFirst.

Is this the first result?

Returns:boolean

true if this is the first row of results, otherwise false

Annotations
@Override
isLastback to summary
public boolean isLast()

Implements org.hibernate.ScrollableResults.isLast.

Doc from org.hibernate.ScrollableResults.isLast.

Is this the last result?

Returns:boolean

true if this is the last row of results.

Annotations
@Override
lastback to summary
public boolean last()

Implements org.hibernate.ScrollableResults.last.

Doc from org.hibernate.ScrollableResults.last.

Go to the last result.

Returns:boolean

true if there are any results

Annotations
@Override
nextback to summary
public boolean next()

Implements org.hibernate.ScrollableResults.next.

Doc from org.hibernate.ScrollableResults.next.

Advance to the next result.

Returns:boolean

true if there is another result

Annotations
@Override
prepareCurrentRowback to summary
private void prepareCurrentRow(boolean underlyingScrollSuccessful)
previousback to summary
public boolean previous()

Implements org.hibernate.ScrollableResults.previous.

Doc from org.hibernate.ScrollableResults.previous.

Retreat to the previous result.

Returns:boolean

true if there is a previous result

Annotations
@Override
scrollback to summary
public boolean scroll(int i)

Implements org.hibernate.ScrollableResults.scroll.

Doc from org.hibernate.ScrollableResults.scroll.

Scroll the specified number of positions from the current position.

Parameters
i:int

a positive (forward) or negative (backward) number of rows

Returns:boolean

true if there is a result at the new location

Annotations
@Override
setRowNumberback to summary
public boolean setRowNumber(int rowNumber) throws HibernateException

Implements org.hibernate.ScrollableResults.setRowNumber.

Doc from org.hibernate.ScrollableResults.setRowNumber.

Set the current position in the result set. Can be numbered from the first position (positive number) or the last row (negative number).

Parameters
rowNumber:int

the row number. A positive number indicates a value numbered from the first row; a negative number indicates a value numbered from the last row.

Returns:boolean

true if there is a row at that row number

Annotations
@Override