Module org.eclipse.persistence.core
Class RemoteScrollableCursor
java.lang.Object
org.eclipse.persistence.queries.Cursor
org.eclipse.persistence.queries.ScrollableCursor
org.eclipse.persistence.internal.sessions.remote.RemoteScrollableCursor
- All Implemented Interfaces:
Serializable,Enumeration,Iterator,ListIterator
Purpose: The object is used as a wrapper to the ScrollableCursor object in the remote transaction (via RMI, CORBA, etc.)
Responsibilities: Wraps a database result set cursor to provide a stream to the remote client side on the resulting selected objects.
Note: Most of the APIs only work with JDBC 2.0- Since:
- TOPLink/Java 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjIDThis is a unique id for remote cursored streamprotected booleanReturn if the stream is closedFields inherited from class org.eclipse.persistence.queries.ScrollableCursor
atEndOfCursor, nextObject, previousObject, previousRowFields inherited from class org.eclipse.persistence.queries.Cursor
executionSession, fields, initiallyConformingIndex, nextRow, objectCollection, policy, position, query, resultSet, selectionCriteriaClone, session, size, statement, translationRow -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int rows) Moves the cursor to the given row number in the result setvoidMoves the cursor to the end of the result set, just after the last row.voidMoves the cursor to the front of the result set, just before the first rowvoidclose()Close the wrapped cursored stream This should be performed whenever the user has finished with the stream.intRetrieves the current row index numberbooleanfirst()Moves the cursor to the first row in the result setprotected intINTERNAL: Retreive the size of the wrapped cursored stream.getID()INTERNAL: Retreive the OID of the wrapped cursored stream.booleanIndicates whether the cursor is after the last row in the result set.booleanIndicates whether the cursor is before the first row in the result set.booleanisClosed()INTERNAL: Return if the stream is closed.booleanisFirst()Indicates whether the cursor is on the first row of the result set.booleanisLast()Indicates whether the cursor is on the last row of the result set.booleanlast()Moves the cursor to the last row in the result setbooleanrelative(int rows) Moves the cursor a relative number of rows, either positive or negative.protected ObjectINTERNAL: This method differs slightly from conventional read() operation on a Java stream.protected ObjectINTERNAL: CR#4139 Read the previous row from the result set.Methods inherited from class org.eclipse.persistence.queries.ScrollableCursor
add, clearNextAndPrevious, clearNextAndPreviousObject, getKnownCursorSize, getNextObject, getPosition, getPreviousObject, hasMoreElements, hasNext, hasNextElement, hasPrevious, loadNext, loadPrevious, next, next, nextElement, nextIndex, previous, previousIndex, set, setNextObject, setPreviousObjectMethods inherited from class org.eclipse.persistence.queries.Cursor
buildAndRegisterObject, clear, finalize, getAccessor, getExecutionSession, getFields, getInitiallyConformingIndex, getObjectCollection, getPageSize, getPolicy, getQuery, getResultSet, getSelectionCriteriaClone, getSession, getStatement, getTranslationRow, 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.Enumeration
asIteratorMethods inherited from interface java.util.Iterator
forEachRemainingMethods inherited from interface java.util.ListIterator
remove
-
Field Details
-
id
This is a unique id for remote cursored stream -
isClosed
protected boolean isClosedReturn if the stream is closed
-
-
Constructor Details
-
RemoteScrollableCursor
-
-
Method Details
-
absolute
Moves the cursor to the given row number in the result set- Overrides:
absolutein classScrollableCursor- Throws:
DatabaseException
-
afterLast
Moves the cursor to the end of the result set, just after the last row.- Overrides:
afterLastin classScrollableCursor- Throws:
DatabaseException
-
beforeFirst
Moves the cursor to the front of the result set, just before the first row- Overrides:
beforeFirstin classScrollableCursor- Throws:
DatabaseException
-
close
Close the wrapped cursored stream This should be performed whenever the user has finished with the stream.- Overrides:
closein classCursor- Throws:
DatabaseException
-
currentIndex
Retrieves the current row index number- Overrides:
currentIndexin classScrollableCursor- Throws:
DatabaseException
-
first
Moves the cursor to the first row in the result set- Overrides:
firstin classScrollableCursor- Throws:
DatabaseException
-
getCursorSize
protected int getCursorSize()INTERNAL: Retreive the size of the wrapped cursored stream.- Overrides:
getCursorSizein classScrollableCursor
-
getID
INTERNAL: Retreive the OID of the wrapped cursored stream. -
isAfterLast
Indicates whether the cursor is after the last row in the result set.- Overrides:
isAfterLastin classScrollableCursor- Throws:
DatabaseException
-
isBeforeFirst
Indicates whether the cursor is before the first row in the result set.- Overrides:
isBeforeFirstin classScrollableCursor- Throws:
DatabaseException
-
isClosed
public boolean isClosed()INTERNAL: Return if the stream is closed. -
isFirst
Indicates whether the cursor is on the first row of the result set.- Overrides:
isFirstin classScrollableCursor- Throws:
DatabaseException
-
isLast
Indicates whether the cursor is on the last row of the result set.- Overrides:
isLastin classScrollableCursor- Throws:
DatabaseException
-
last
Moves the cursor to the last row in the result set- Overrides:
lastin classScrollableCursor- Throws:
DatabaseException
-
relative
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- Overrides:
relativein classScrollableCursor- Throws:
DatabaseException
-
retrieveNextObject
INTERNAL: 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- Overrides:
retrieveNextObjectin classScrollableCursor- Returns:
- next object in stream
- Throws:
DatabaseException- if read pass end of streamQueryException
-
retrievePreviousObject
INTERNAL: CR#4139 Read the previous row from the result set. It is used solely for scrollable cursor support.- Overrides:
retrievePreviousObjectin classScrollableCursor- Throws:
DatabaseException
-