Top Description Fields Constructors Methods
org.hibernate.internal

public Class FetchingScrollableResultsImpl

extends AbstractScrollableResults
Class Inheritance
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, org.hibernate.HibernateException, org.hibernate.engine.spi.QueryParameters, .SharedSessionContractImplementor, org.hibernate.hql.internal.HolderInstantiator, org.hibernate.loader.Loader, org.hibernate.type.Type

Implementation of ScrollableResults which can handle collection fetches.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private int
private Object[]
private Integer

Constructor Summary

AccessConstructor and Description
public
FetchingScrollableResultsImpl(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 FetchingScrollableResultsImpl.

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.
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?
private boolean
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.
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
positions
)

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

currentPositionback to summary
private int currentPosition
currentRowback to summary
private Object[] currentRow
maxPositionback to summary
private Integer maxPosition

Constructor Detail

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

Constructs a FetchingScrollableResultsImpl.

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
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()

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
isResultSetEmptyback to summary
private boolean isResultSetEmpty()
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
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 positions)

Implements org.hibernate.ScrollableResults.scroll.

Doc from org.hibernate.ScrollableResults.scroll.

Scroll the specified number of positions from the current position.

Parameters
positions: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)

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