Package org.hibernate.internal
Class FetchingScrollableResultsImpl<R>
- java.lang.Object
-
- org.hibernate.internal.AbstractScrollableResults<R>
-
- org.hibernate.internal.FetchingScrollableResultsImpl<R>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ScrollableResultsImplementor<R>
,ScrollableResults<R>
public class FetchingScrollableResultsImpl<R> extends AbstractScrollableResults<R>
Implementation of ScrollableResults which can handle collection fetches.
-
-
Constructor Summary
Constructors Constructor Description FetchingScrollableResultsImpl(JdbcValues jdbcValues, JdbcValuesSourceProcessingOptions processingOptions, JdbcValuesSourceProcessingStateStandardImpl jdbcValuesSourceProcessingState, RowProcessingStateStandardImpl rowProcessingState, RowReader<R> rowReader, SharedSessionContractImplementor persistenceContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterLast()
Go to a location just after the last result.void
beforeFirst()
Go to a location just before first result.boolean
first()
Go to the first result.protected R
getCurrentRow()
int
getRowNumber()
Get the current position in the 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
position(int position)
Moves the result cursor to the specified position.boolean
previous()
Retreat to the previous result.boolean
scroll(int positions)
Scroll the specified number of positions from the current position.boolean
setRowNumber(int rowNumber)
Set the current position in the result set.-
Methods inherited from class org.hibernate.internal.AbstractScrollableResults
afterScrollOperation, close, get, getJdbcValues, getJdbcValuesSourceProcessingState, getPersistenceContext, getProcessingOptions, getRowProcessingState, getRowReader, isClosed, setFetchSize
-
-
-
-
Constructor Detail
-
FetchingScrollableResultsImpl
public FetchingScrollableResultsImpl(JdbcValues jdbcValues, JdbcValuesSourceProcessingOptions processingOptions, JdbcValuesSourceProcessingStateStandardImpl jdbcValuesSourceProcessingState, RowProcessingStateStandardImpl rowProcessingState, RowReader<R> rowReader, SharedSessionContractImplementor persistenceContext)
-
-
Method Detail
-
getCurrentRow
protected R getCurrentRow()
- Specified by:
getCurrentRow
in classAbstractScrollableResults<R>
-
next
public boolean next()
Description copied from interface:ScrollableResults
Advance to the next result.- Returns:
true
if there is another result
-
previous
public boolean previous()
Description copied from interface:ScrollableResults
Retreat to the previous result.- Returns:
true
if there is a previous result
-
scroll
public boolean scroll(int positions)
Description copied from interface:ScrollableResults
Scroll the specified number of positions from the current position.- Parameters:
positions
- a positive (forward) or negative (backward) number of rows- Returns:
true
if there is a result at the new location
-
position
public boolean position(int position)
Description copied from interface:ScrollableResults
Moves the result cursor to the specified position.- Returns:
true
if there is a result at the new location
-
last
public boolean last()
Description copied from interface:ScrollableResults
Go to the last result.- Returns:
true
if there are any results
-
first
public boolean first()
Description copied from interface:ScrollableResults
Go to the first result.- Returns:
true
if there are any results
-
beforeFirst
public void beforeFirst()
Description copied from interface:ScrollableResults
Go to a location just before first result.This is the location of the cursor on a newly returned scrollable result.
-
afterLast
public void afterLast()
Description copied from interface:ScrollableResults
Go to a location just after the last result.
-
isFirst
public boolean isFirst()
Description copied from interface:ScrollableResults
Is this the first result?- Returns:
true
if this is the first row of results, otherwisefalse
-
isLast
public boolean isLast()
Description copied from interface:ScrollableResults
Is this the last result?- Returns:
true
if this is the last row of results.
-
getRowNumber
public int getRowNumber()
Description copied from interface:ScrollableResults
Get the current position in the results.The first position is number 0 (unlike JDBC).
- Returns:
- The current position number, numbered from 0; -1 indicates that there is no current row
-
setRowNumber
public boolean setRowNumber(int rowNumber)
Description copied from interface:ScrollableResults
Set the current position in the result set.Can be numbered from the first result (positive number) or backward from the last result (negative number).
- Parameters:
rowNumber
- 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:
- true if there is a row at that row number
-
-