Package org.eclipse.persistence.queries
Class ScrollableCursor
java.lang.Object
org.eclipse.persistence.queries.Cursor
org.eclipse.persistence.queries.ScrollableCursor
- All Implemented Interfaces:
Serializable,Enumeration,Iterator,ListIterator
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanInternal flag indicating if the end of the cursor has been reachedprotected Objectprotected Objectprotected org.eclipse.persistence.internal.sessions.AbstractRecordStore the previous row, for 1-m joining.Fields inherited from class org.eclipse.persistence.queries.Cursor
executionSession, fields, initiallyConformingIndex, nextRow, objectCollection, policy, position, query, resultSet, selectionCriteriaClone, session, size, statement, translationRow -
Constructor Summary
ConstructorsConstructorDescriptionINTERNAL: Default constructor.ScrollableCursor(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, ScrollableCursorPolicy policy) INTERNAL: constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int rows) PUBLIC: Moves the cursor to the given row number in the result setvoidPUBLIC: Add is not support for scrollable cursors.voidPUBLIC: Moves the cursor to the end of the result set, just after the last row.voidPUBLIC: Moves the cursor to the front of the result set, just before the first rowprotected voidINTERNAL: Clear the cached next and previous object and row values.protected voidINTERNAL: Clear only the cached next and previous object values.intPUBLIC: Retrieves the current row index numberbooleanfirst()PUBLIC: Moves the cursor to the first row in the result setprotected intINTERNAL: Retrieve the size of the open cursor by executing a count on the same query as the cursor.protected intprotected ObjectintPUBLIC: Retrieves the current cursor position (current row).protected ObjectbooleanPUBLIC: Indicates whether the cursor can move to the the next rowbooleanhasNext()PUBLIC: Indicates whether the cursor can move to the the next rowbooleanPUBLIC: Indicates whether the cursor can move to the the next rowbooleanPUBLIC: Indicates whether the cursor can move to the the previous rowbooleanPUBLIC: Indicates whether the cursor is after the last row in the result set.booleanPUBLIC: Indicates whether the cursor is before the first row in the result set.booleanisFirst()PUBLIC: Indicates whether the cursor is on the first row of the result set.booleanisLast()PUBLIC: Indicates whether the cursor is on the last row of the result set.booleanlast()PUBLIC: Moves the cursor to the last row in the result setprotected voidloadNext()Load the next objectprotected voidLoad the previous object.next()PUBLIC: This method differs slightly from conventional read() operation on a Java stream.next(int number) PUBLIC: This method differs slightly from conventional read() operation on a Java stream.PUBLIC: Return the next object from the collection, if beyond the read limit read from the cursor.intPUBLIC: Retrieves the next row index (against the current row)previous()PUBLIC: Return the previous object from the collection.intPUBLIC: Retrieves the previous row index (against the current row)booleanrelative(int rows) PUBLIC: Moves the cursor a relative number of rows, either positive or negative.protected ObjectINTERNAL: Read the next row from the result set.protected ObjectINTERNAL: CR#4139 Read the previous row from the result set.voidPUBLIC: Set is not supported for scrollable cursors.protected voidsetNextObject(Object nextObject) protected voidsetPreviousObject(Object previousObject) Methods inherited from class org.eclipse.persistence.queries.Cursor
buildAndRegisterObject, clear, close, finalize, getAccessor, getExecutionSession, getFields, getInitiallyConformingIndex, getObjectCollection, getPageSize, getPolicy, getQuery, getResultSet, getSelectionCriteriaClone, getSession, getStatement, getTranslationRow, isClosed, remove, setExecutionSession, setFields, setInitiallyConformingIndex, setObjectCollection, setPolicy, setPosition, setResultSet, setSelectionCriteriaClone, setSession, setSize, setTranslationRow, sizeMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemainingMethods inherited from interface java.util.ListIterator
remove
-
Field Details
-
nextObject
-
previousObject
-
previousRow
protected org.eclipse.persistence.internal.sessions.AbstractRecord previousRowStore the previous row, for 1-m joining. -
atEndOfCursor
protected boolean atEndOfCursorInternal flag indicating if the end of the cursor has been reached
-
-
Constructor Details
-
ScrollableCursor
public ScrollableCursor()INTERNAL: Default constructor. -
ScrollableCursor
public ScrollableCursor(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, ScrollableCursorPolicy policy) INTERNAL: constructor.
-
-
Method Details
-
absolute
PUBLIC: Moves the cursor to the given row number in the result set- Throws:
DatabaseException
-
add
PUBLIC: Add is not support for scrollable cursors.- Specified by:
addin interfaceListIterator- Throws:
QueryException
-
afterLast
PUBLIC: Moves the cursor to the end of the result set, just after the last row.- Throws:
DatabaseException
-
beforeFirst
PUBLIC: Moves the cursor to the front of the result set, just before the first row- Throws:
DatabaseException
-
clearNextAndPrevious
protected void clearNextAndPrevious()INTERNAL: Clear the cached next and previous object and row values. This must be called whenever the cursor is re-positioned. -
clearNextAndPreviousObject
protected void clearNextAndPreviousObject()INTERNAL: Clear only the cached next and previous object values. Called by previous() and next() to maintain the cached next and previous row values. -
currentIndex
PUBLIC: Retrieves the current row index number- Throws:
DatabaseException
-
first
PUBLIC: Moves the cursor to the first row in the result set- Throws:
DatabaseException
-
getCursorSize
INTERNAL: Retrieve the size of the open cursor by executing a count on the same query as the cursor.- Specified by:
getCursorSizein classCursor- Throws:
DatabaseException
-
getKnownCursorSize
protected int getKnownCursorSize() -
getNextObject
-
getPosition
PUBLIC: Retrieves the current cursor position (current row). The first row is number 1, the second number 2, and so on. Unlike java.sql.ResultSet.getRow(), 0 is not returned if afterLast. Instead size() + 1 is returned.- Specified by:
getPositionin classCursor- Returns:
- the current row number; 0 if there is no current row
- Throws:
DatabaseException- if a database access error occurs
-
getPreviousObject
-
hasMoreElements
PUBLIC: Indicates whether the cursor can move to the the next row- Specified by:
hasMoreElementsin interfaceEnumeration- Throws:
DatabaseException
-
hasNext
PUBLIC: Indicates whether the cursor can move to the the next row- Specified by:
hasNextin interfaceIterator- Specified by:
hasNextin interfaceListIterator- Throws:
DatabaseException
-
hasNextElement
PUBLIC: Indicates whether the cursor can move to the the next row- Throws:
DatabaseException
-
hasPrevious
PUBLIC: Indicates whether the cursor can move to the the previous row- Specified by:
hasPreviousin interfaceListIterator- Throws:
DatabaseException
-
isAfterLast
PUBLIC: Indicates whether the cursor is after the last row in the result set.- Throws:
DatabaseException
-
isBeforeFirst
PUBLIC: Indicates whether the cursor is before the first row in the result set.- Throws:
DatabaseException
-
isFirst
PUBLIC: Indicates whether the cursor is on the first row of the result set.- Throws:
DatabaseException
-
isLast
PUBLIC: Indicates whether the cursor is on the last row of the result set.- Throws:
DatabaseException
-
last
PUBLIC: Moves the cursor to the last row in the result set- Throws:
DatabaseException
-
loadNext
protected void loadNext()Load the next object -
loadPrevious
protected void loadPrevious()Load the previous object. This is used solely for scrollable cursor support -
next
PUBLIC: This method differs slightly from conventional read() operation on a Java stream. This method return the next object in the collection rather than specifying the number of bytes to be read in. Return the next object from the collection, if beyond the read limit read from the cursor- Specified by:
nextin interfaceIterator- Specified by:
nextin interfaceListIterator- Returns:
- - next object in stream
- Throws:
DatabaseException- if read pass end of streamQueryException
-
next
PUBLIC: This method differs slightly from conventional read() operation on a Java stream. This method returns the next number of objects in the collection in a vector. Return the next specified number of objects from the collection, if beyond the read limit read from the cursor- Parameters:
number- - number of objects to be returned- Returns:
- - vector containing next number of objects
- Throws:
DatabaseException- if read pass end of stream
-
nextElement
PUBLIC: Return the next object from the collection, if beyond the read limit read from the cursor.- Specified by:
nextElementin interfaceEnumeration- Returns:
- next object in stream
- Throws:
DatabaseExceptionQueryException
-
nextIndex
PUBLIC: Retrieves the next row index (against the current row)- Specified by:
nextIndexin interfaceListIterator- Throws:
DatabaseException
-
previous
PUBLIC: Return the previous object from the collection.- Specified by:
previousin interfaceListIterator- Returns:
- - previous object in stream
- Throws:
DatabaseException- if read pass first of streamQueryException
-
previousIndex
PUBLIC: Retrieves the previous row index (against the current row)- Specified by:
previousIndexin interfaceListIterator- Throws:
DatabaseException
-
relative
PUBLIC: Moves the cursor a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row- Throws:
DatabaseException
-
retrieveNextObject
INTERNAL: Read the next row from the result set.- Specified by:
retrieveNextObjectin classCursor- Throws:
DatabaseException
-
retrievePreviousObject
INTERNAL: CR#4139 Read the previous row from the result set. It is used solely for scrollable cursor support.- Throws:
DatabaseException
-
set
PUBLIC: Set is not supported for scrollable cursors.- Specified by:
setin interfaceListIterator- Throws:
QueryException
-
setNextObject
-
setPreviousObject
-