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:
java.io.Serializable,java.util.Enumeration,java.util.Iterator,java.util.ListIterator
public class RemoteScrollableCursor extends ScrollableCursor
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
- Author:
- King (Yaoping) Wang
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.rmi.server.ObjIDidThis is a unique id for remote cursored streamprotected booleanisClosedReturn if the stream is closed-
Fields inherited from class org.eclipse.persistence.queries.ScrollableCursor
atEndOfCursor, nextObject, previousObject, previousRow
-
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
Constructors Constructor Description RemoteScrollableCursor(ScrollableCursor serverScrollableCursor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabsolute(int rows)Moves the cursor to the given row number in the result setvoidafterLast()Moves the cursor to the end of the result set, just after the last row.voidbeforeFirst()Moves 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.intcurrentIndex()Retrieves the current row index numberbooleanfirst()Moves the cursor to the first row in the result setprotected intgetCursorSize()INTERNAL: Retreive the size of the wrapped cursored stream.java.rmi.server.ObjIDgetID()INTERNAL: Retreive the OID of the wrapped cursored stream.booleanisAfterLast()Indicates whether the cursor is after the last row in the result set.booleanisBeforeFirst()Indicates 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 java.lang.ObjectretrieveNextObject()INTERNAL: This method differs slightly from conventinal read() operation on a Java stream.protected java.lang.ObjectretrievePreviousObject()INTERNAL: 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, setPreviousObject
-
Methods 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, size
-
-
-
-
Constructor Detail
-
RemoteScrollableCursor
public RemoteScrollableCursor(ScrollableCursor serverScrollableCursor)
-
-
Method Detail
-
absolute
public boolean absolute(int rows) throws DatabaseExceptionMoves the cursor to the given row number in the result set- Overrides:
absolutein classScrollableCursor- Throws:
DatabaseException
-
afterLast
public void afterLast() throws DatabaseExceptionMoves the cursor to the end of the result set, just after the last row.- Overrides:
afterLastin classScrollableCursor- Throws:
DatabaseException
-
beforeFirst
public void beforeFirst() throws DatabaseExceptionMoves the cursor to the front of the result set, just before the first row- Overrides:
beforeFirstin classScrollableCursor- Throws:
DatabaseException
-
close
public void close() throws DatabaseExceptionClose the wrapped cursored stream This should be performed whenever the user has finished with the stream.- Overrides:
closein classCursor- Throws:
DatabaseException
-
currentIndex
public int currentIndex() throws DatabaseExceptionRetrieves the current row index number- Overrides:
currentIndexin classScrollableCursor- Throws:
DatabaseException
-
first
public boolean first() throws DatabaseExceptionMoves 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
public java.rmi.server.ObjID getID()
INTERNAL: Retreive the OID of the wrapped cursored stream.
-
isAfterLast
public boolean isAfterLast() throws DatabaseExceptionIndicates whether the cursor is after the last row in the result set.- Overrides:
isAfterLastin classScrollableCursor- Throws:
DatabaseException
-
isBeforeFirst
public boolean isBeforeFirst() throws DatabaseExceptionIndicates 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
public boolean isFirst() throws DatabaseExceptionIndicates whether the cursor is on the first row of the result set.- Overrides:
isFirstin classScrollableCursor- Throws:
DatabaseException
-
isLast
public boolean isLast() throws DatabaseExceptionIndicates whether the cursor is on the last row of the result set.- Overrides:
isLastin classScrollableCursor- Throws:
DatabaseException
-
last
public boolean last() throws DatabaseExceptionMoves the cursor to the last row in the result set- Overrides:
lastin classScrollableCursor- Throws:
DatabaseException
-
relative
public boolean relative(int rows) throws DatabaseExceptionMoves 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
protected java.lang.Object retrieveNextObject() throws DatabaseException, QueryExceptionINTERNAL: This method differs slightly from conventinal 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:
DatabaseExceptionQueryException
-
retrievePreviousObject
protected java.lang.Object retrievePreviousObject() throws DatabaseExceptionINTERNAL: CR#4139 Read the previous row from the result set. It is used solely for scrollable cursor support.- Overrides:
retrievePreviousObjectin classScrollableCursor- Throws:
DatabaseException
-
-