Package org.hibernate.internal
Class EmptyScrollableResults
- java.lang.Object
- org.hibernate.internal.EmptyScrollableResults
- All Implemented Interfaces:
Closeable,AutoCloseable,ScrollableResultsImplementor,ScrollableResults
public classEmptyScrollableResultsextendsObjectimplementsScrollableResultsImplementor
Field Summary
Fields Modifier and Type Field Description staticScrollableResultsImplementorINSTANCE
Constructor Summary
Constructors Constructor Description EmptyScrollableResults()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterLast()Go to a location just after the last result.voidbeforeFirst()Go to a location just before first result.voidclose()Release resources immediately.booleanfirst()Go to the first result.Object[]get()Get the current row of results.intgetRowNumber()Get the current position in the results.booleanisClosed()booleanisFirst()Is this the first result?booleanisLast()Is this the last result?booleanlast()Go to the last result.booleannext()Advance to the next result.booleanposition(int position)Moves the result cursor to the specified position.booleanprevious()Retreat to the previous result.booleanscroll(int positions)Scroll the specified number of positions from the current position.voidsetFetchSize(int fetchSize)Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.booleansetRowNumber(int rowNumber)Set the current position in the result set.
Field Detail
INSTANCE
public static final ScrollableResultsImplementor INSTANCE
Method Detail
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceScrollableResultsImplementor
close
public void close()
Description copied from interface:ScrollableResultsRelease resources immediately.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceScrollableResults
next
public boolean next()
Description copied from interface:ScrollableResultsAdvance to the next result.- Specified by:
nextin interfaceScrollableResults- Returns:
trueif there is another result
previous
public boolean previous()
Description copied from interface:ScrollableResultsRetreat to the previous result.- Specified by:
previousin interfaceScrollableResults- Returns:
trueif there is a previous result
scroll
public boolean scroll(int positions)
Description copied from interface:ScrollableResultsScroll the specified number of positions from the current position.- Specified by:
scrollin interfaceScrollableResults- Parameters:
positions- a positive (forward) or negative (backward) number of rows- Returns:
trueif there is a result at the new location
position
public boolean position(int position)
Description copied from interface:ScrollableResultsMoves the result cursor to the specified position.- Specified by:
positionin interfaceScrollableResults- Returns:
trueif there is a result at the new location
last
public boolean last()
Description copied from interface:ScrollableResultsGo to the last result.- Specified by:
lastin interfaceScrollableResults- Returns:
trueif there are any results
first
public boolean first()
Description copied from interface:ScrollableResultsGo to the first result.- Specified by:
firstin interfaceScrollableResults- Returns:
trueif there are any results
beforeFirst
public void beforeFirst()
Description copied from interface:ScrollableResultsGo to a location just before first result.This is the location of the cursor on a newly returned scrollable result.
- Specified by:
beforeFirstin interfaceScrollableResults
afterLast
public void afterLast()
Description copied from interface:ScrollableResultsGo to a location just after the last result.- Specified by:
afterLastin interfaceScrollableResults
isFirst
public boolean isFirst()
Description copied from interface:ScrollableResultsIs this the first result?- Specified by:
isFirstin interfaceScrollableResults- Returns:
trueif this is the first row of results, otherwisefalse
isLast
public boolean isLast()
Description copied from interface:ScrollableResultsIs this the last result?- Specified by:
isLastin interfaceScrollableResults- Returns:
trueif this is the last row of results.
getRowNumber
public int getRowNumber()
Description copied from interface:ScrollableResultsGet the current position in the results.The first position is number 0 (unlike JDBC).
- Specified by:
getRowNumberin interfaceScrollableResults- 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:ScrollableResultsSet the current position in the result set.Can be numbered from the first result (positive number) or backward from the last result (negative number).
- Specified by:
setRowNumberin interfaceScrollableResults- 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
setFetchSize
public void setFetchSize(int fetchSize)
Description copied from interface:ScrollableResultsGives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. If0, the JDBC driver's default setting will be used.- Specified by:
setFetchSizein interfaceScrollableResults- See Also:
ResultSet.setFetchSize(int),JdbcSettings.STATEMENT_FETCH_SIZE
get
public Object[] get()
Description copied from interface:ScrollableResultsGet the current row of results.- Specified by:
getin interfaceScrollableResults- Returns:
- The array of results