Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions.remote

public Class RemoteScrollableCursor

extends ScrollableCursor
Class Inheritance
Imports
java.rmi.server.ObjID, org.eclipse.persistence.exceptions.DatabaseException, .QueryException, org.eclipse.persistence.queries.ScrollableCursor, org.eclipse.persistence.sessions.remote.DistributedSession

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
Author
King (Yaoping) Wang
Since
TOPLink/Java 3.0

Field Summary

Modifier and TypeField and Description
protected ObjID
id

This is a unique id for remote cursored stream

protected boolean
isClosed

Return if the stream is closed

Inherited from org.eclipse.persistence.queries.ScrollableCursor:
atEndOfCursornextObjectpreviousObjectpreviousRow

Constructor Summary

AccessConstructor and Description
public
RemoteScrollableCursor(ScrollableCursor serverScrollableCursor)

Method Summary

Modifier and TypeMethod and Description
public boolean
absolute(int rows)

Overrides org.eclipse.persistence.queries.ScrollableCursor.absolute.

Moves the cursor to the given row number in the result set
public void
afterLast()

Overrides org.eclipse.persistence.queries.ScrollableCursor.afterLast.

Moves the cursor to the end of the result set, just after the last row.
public void
beforeFirst()

Overrides org.eclipse.persistence.queries.ScrollableCursor.beforeFirst.

Moves the cursor to the front of the result set, just before the first row
public void
close()

Overrides org.eclipse.persistence.queries.Cursor.close.

Close the wrapped cursored stream This should be performed whenever the user has finished with the stream.
public int
currentIndex()

Overrides org.eclipse.persistence.queries.ScrollableCursor.currentIndex.

Retrieves the current row index number
public boolean
first()

Overrides org.eclipse.persistence.queries.ScrollableCursor.first.

Moves the cursor to the first row in the result set
protected int
getCursorSize()

Overrides org.eclipse.persistence.queries.ScrollableCursor.getCursorSize.

INTERNAL: Retreive the size of the wrapped cursored stream.
public ObjID
getID()

INTERNAL: Retreive the OID of the wrapped cursored stream.

public boolean
isAfterLast()

Overrides org.eclipse.persistence.queries.ScrollableCursor.isAfterLast.

Indicates whether the cursor is after the last row in the result set.
public boolean
isBeforeFirst()

Overrides org.eclipse.persistence.queries.ScrollableCursor.isBeforeFirst.

Indicates whether the cursor is before the first row in the result set.
public boolean
isClosed()

Overrides org.eclipse.persistence.queries.Cursor.isClosed.

INTERNAL: Return if the stream is closed.
public boolean
isFirst()

Overrides org.eclipse.persistence.queries.ScrollableCursor.isFirst.

Indicates whether the cursor is on the first row of the result set.
public boolean
isLast()

Overrides org.eclipse.persistence.queries.ScrollableCursor.isLast.

Indicates whether the cursor is on the last row of the result set.
public boolean
last()

Overrides org.eclipse.persistence.queries.ScrollableCursor.last.

Moves the cursor to the last row in the result set
public boolean
relative(int rows)

Overrides org.eclipse.persistence.queries.ScrollableCursor.relative.

Moves the cursor a relative number of rows, either positive or negative.
protected Object

Returns:

next object in stream
retrieveNextObject
()

Overrides org.eclipse.persistence.queries.ScrollableCursor.retrieveNextObject.

INTERNAL: This method differs slightly from conventional read() operation on a Java stream.
protected Object
retrievePreviousObject()

Overrides org.eclipse.persistence.queries.ScrollableCursor.retrievePreviousObject.

INTERNAL: CR#4139 Read the previous row from the result set.
Inherited from org.eclipse.persistence.queries.ScrollableCursor:
addclearNextAndPreviousclearNextAndPreviousObjectgetKnownCursorSizegetNextObjectgetPositiongetPreviousObjecthasMoreElementshasNexthasNextElementhasPreviousloadNextloadPreviousnextnextnextElementnextIndexpreviouspreviousIndexsetsetNextObjectsetPreviousObject

Field Detail

idback to summary
protected ObjID id

This is a unique id for remote cursored stream

isClosedback to summary
protected boolean isClosed

Return if the stream is closed

Constructor Detail

RemoteScrollableCursorback to summary
public RemoteScrollableCursor(ScrollableCursor serverScrollableCursor)

Method Detail

absoluteback to summary
public boolean absolute(int rows) throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.absolute.

Moves the cursor to the given row number in the result set

Annotations
@Override
afterLastback to summary
public void afterLast() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.afterLast.

Moves the cursor to the end of the result set, just after the last row.

Annotations
@Override
beforeFirstback to summary
public void beforeFirst() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.beforeFirst.

Moves the cursor to the front of the result set, just before the first row

Annotations
@Override
closeback to summary
public void close() throws DatabaseException

Overrides org.eclipse.persistence.queries.Cursor.close.

Close the wrapped cursored stream This should be performed whenever the user has finished with the stream.

Annotations
@Override
currentIndexback to summary
public int currentIndex() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.currentIndex.

Retrieves the current row index number

Annotations
@Override
firstback to summary
public boolean first() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.first.

Moves the cursor to the first row in the result set

Annotations
@Override
getCursorSizeback to summary
protected int getCursorSize()

Overrides org.eclipse.persistence.queries.ScrollableCursor.getCursorSize.

INTERNAL: Retreive the size of the wrapped cursored stream.

Annotations
@Override
getIDback to summary
public ObjID getID()

INTERNAL: Retreive the OID of the wrapped cursored stream.

isAfterLastback to summary
public boolean isAfterLast() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.isAfterLast.

Indicates whether the cursor is after the last row in the result set.

Annotations
@Override
isBeforeFirstback to summary
public boolean isBeforeFirst() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.isBeforeFirst.

Indicates whether the cursor is before the first row in the result set.

Annotations
@Override
isClosedback to summary
public boolean isClosed()

Overrides org.eclipse.persistence.queries.Cursor.isClosed.

INTERNAL: Return if the stream is closed.

Annotations
@Override
isFirstback to summary
public boolean isFirst() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.isFirst.

Indicates whether the cursor is on the first row of the result set.

Annotations
@Override
isLastback to summary
public boolean isLast() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.isLast.

Indicates whether the cursor is on the last row of the result set.

Annotations
@Override
lastback to summary
public boolean last() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.last.

Moves the cursor to the last row in the result set

Annotations
@Override
relativeback to summary
public boolean relative(int rows) throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.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

Annotations
@Override
retrieveNextObjectback to summary
protected Object retrieveNextObject() throws DatabaseException, QueryException

Overrides org.eclipse.persistence.queries.ScrollableCursor.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

Returns:Object

next object in stream

Annotations
@Override
Exceptions
DatabaseException:
if read pass end of stream
retrievePreviousObjectback to summary
protected Object retrievePreviousObject() throws DatabaseException

Overrides org.eclipse.persistence.queries.ScrollableCursor.retrievePreviousObject.

INTERNAL: CR#4139 Read the previous row from the result set. It is used solely for scrollable cursor support.

Annotations
@Override