Top Fields Constructors Methods
org.eclipse.persistence.queries

public Class ScrollableCursor

extends Cursor
implements ListIterator
Class Inheritance
All Implemented Interfaces
java.util.ListIterator, java.util.Iterator
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.remote.RemoteScrollableCursor
Imports
java.util.*, java.sql.*, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.helper.InvalidObject, org.eclipse.persistence.internal.queries.JoinedAttributeManager, org.eclipse.persistence.internal.sessions.AbstractRecord, org.eclipse.persistence.internal.databaseaccess.*

Field Summary

Modifier and TypeField and Description
protected boolean
atEndOfCursor

Internal flag indicating if the end of the cursor has been reached

protected transient Object
protected transient Object
protected AbstractRecord
previousRow

Store the previous row, for 1-m joining.

Inherited from org.eclipse.persistence.queries.Cursor:
executionSessionfieldsinitiallyConformingIndexnextRowobjectCollectionpolicypositionqueryresultSetselectionCriteriaClonesessionsizestatementtranslationRow

Constructor Summary

AccessConstructor and Description
public
ScrollableCursor()

INTERNAL: Default constructor.

public
ScrollableCursor(DatabaseCall call, ScrollableCursorPolicy policy)

INTERNAL: constructor.

Method Summary

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

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

public void
add(Object
the element to insert
object
)

Implements java.util.ListIterator.add.

PUBLIC: Add is not support for scrollable cursors.
public void
afterLast()

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

public void
beforeFirst()

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

protected void
clearNextAndPrevious()

INTERNAL: Clear the cached next and previous object and row values.

protected void
clearNextAndPreviousObject()

INTERNAL: Clear only the cached next and previous object values.

public int
currentIndex()

PUBLIC: Retrieves the current row index number

public boolean
first()

PUBLIC: Moves the cursor to the first row in the result set

protected int
getCursorSize()

Implements abstract org.eclipse.persistence.queries.Cursor.getCursorSize.

INTERNAL: Retrieve the size of the open cursor by executing a count on the same query as the cursor.
protected int
protected Object
public int

Returns:

the current row number; 0 if there is no current row
getPosition
()

Implements abstract org.eclipse.persistence.queries.Cursor.getPosition.

PUBLIC: Retrieves the current cursor position (current row).
protected Object
public boolean
hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

PUBLIC: Indicates whether the cursor can move to the the next row
public boolean
hasNext()

Implements java.util.ListIterator.hasNext, java.util.Iterator.hasNext.

PUBLIC: Indicates whether the cursor can move to the the next row
public boolean
hasNextElement()

PUBLIC: Indicates whether the cursor can move to the the next row

public boolean
hasPrevious()

Implements java.util.ListIterator.hasPrevious.

PUBLIC: Indicates whether the cursor can move to the the previous row
public boolean
isAfterLast()

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

public boolean
isBeforeFirst()

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

public boolean
isFirst()

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

public boolean
isLast()

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

public boolean
last()

PUBLIC: Moves the cursor to the last row in the result set

protected void
loadNext()

Load the next object

protected void
loadPrevious()

Load the previous object.

public Object

Returns:

- next object in stream
next
()

Implements java.util.ListIterator.next, java.util.Iterator.next.

PUBLIC: This method differs slightly from conventional read() operation on a Java stream.
public List<Object>

Returns:

- vector containing next number of objects
next
(int
- number of objects to be returned
number
)

PUBLIC: This method differs slightly from conventional read() operation on a Java stream.

public Object

Returns:

next object in stream
nextElement
()

Implements java.util.Enumeration.nextElement.

PUBLIC: Return the next object from the collection, if beyond the read limit read from the cursor.
public int
nextIndex()

Implements java.util.ListIterator.nextIndex.

PUBLIC: Retrieves the next row index (against the current row)
public Object

Returns:

- previous object in stream
previous
()

Implements java.util.ListIterator.previous.

PUBLIC: Return the previous object from the collection.
public int
previousIndex()

Implements java.util.ListIterator.previousIndex.

PUBLIC: Retrieves the previous row index (against the current row)
public boolean
relative(int rows)

PUBLIC: Moves the cursor a relative number of rows, either positive or negative.

protected Object
retrieveNextObject()

Implements abstract org.eclipse.persistence.queries.Cursor.retrieveNextObject.

INTERNAL: Read the next row from the result set.
protected Object
retrievePreviousObject()

INTERNAL: CR#4139 Read the previous row from the result set.

public void
set(Object
the element with which to replace the last element returned by next or previous
object
)

Implements java.util.ListIterator.set.

PUBLIC: Set is not supported for scrollable cursors.
protected void
setNextObject(Object nextObject)

protected void
setPreviousObject(Object previousObject)

Inherited from org.eclipse.persistence.queries.Cursor:
buildAndRegisterObjectclearclosefinalizegetAccessorgetExecutionSessiongetFieldsgetInitiallyConformingIndexgetObjectCollectiongetPageSizegetPolicygetQuerygetResultSetgetSelectionCriteriaClonegetSessiongetStatementgetTranslationRowisClosedremovesetExecutionSessionsetFieldssetInitiallyConformingIndexsetObjectCollectionsetPolicysetPositionsetResultSetsetSelectionCriteriaClonesetSessionsetSizesetTranslationRowsize

Field Detail

atEndOfCursorback to summary
protected boolean atEndOfCursor

Internal flag indicating if the end of the cursor has been reached

nextObjectback to summary
protected transient Object nextObject
previousObjectback to summary
protected transient Object previousObject
previousRowback to summary
protected AbstractRecord previousRow

Store the previous row, for 1-m joining.

Constructor Detail

ScrollableCursorback to summary
public ScrollableCursor()

INTERNAL: Default constructor.

ScrollableCursorback to summary
public ScrollableCursor(DatabaseCall call, ScrollableCursorPolicy policy)

INTERNAL: constructor.

Method Detail

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

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

addback to summary
public void add(Object object) throws QueryException

Implements java.util.ListIterator.add.

PUBLIC: Add is not support for scrollable cursors.

Parameters
object:Object

Doc from java.util.ListIterator.add.

the element to insert

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

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

beforeFirstback to summary
public void beforeFirst() throws DatabaseException

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

clearNextAndPreviousback to summary
protected void clearNextAndPrevious()

INTERNAL: Clear the cached next and previous object and row values. This must be called whenever the cursor is re-positioned.

clearNextAndPreviousObjectback to summary
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.

currentIndexback to summary
public int currentIndex() throws DatabaseException

PUBLIC: Retrieves the current row index number

firstback to summary
public boolean first() throws DatabaseException

PUBLIC: Moves the cursor to the first row in the result set

getCursorSizeback to summary
protected int getCursorSize() throws DatabaseException

Implements abstract org.eclipse.persistence.queries.Cursor.getCursorSize.

INTERNAL: Retrieve the size of the open cursor by executing a count on the same query as the cursor.

Annotations
@Override
getKnownCursorSizeback to summary
protected int getKnownCursorSize()
getNextObjectback to summary
protected Object getNextObject()
getPositionback to summary
public int getPosition() throws DatabaseException

Implements abstract org.eclipse.persistence.queries.Cursor.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.

Returns:int

the current row number; 0 if there is no current row

Annotations
@Override
Exceptions
DatabaseException:
if a database access error occurs
getPreviousObjectback to summary
protected Object getPreviousObject()
hasMoreElementsback to summary
public boolean hasMoreElements() throws DatabaseException

Implements java.util.Enumeration.hasMoreElements.

PUBLIC: Indicates whether the cursor can move to the the next row

Returns:boolean

Doc from java.util.Enumeration.hasMoreElements.

true if and only if this enumeration object contains at least one more element to provide; false otherwise.

Annotations
@Override
hasNextback to summary
public boolean hasNext() throws DatabaseException

Implements java.util.ListIterator.hasNext, java.util.Iterator.hasNext.

PUBLIC: Indicates whether the cursor can move to the the next row

Returns:boolean

Doc from java.util.ListIterator.hasNext.

true if the list iterator has more elements when traversing the list in the forward direction

Annotations
@Override
hasNextElementback to summary
public boolean hasNextElement() throws DatabaseException

PUBLIC: Indicates whether the cursor can move to the the next row

hasPreviousback to summary
public boolean hasPrevious() throws DatabaseException

Implements java.util.ListIterator.hasPrevious.

PUBLIC: Indicates whether the cursor can move to the the previous row

Returns:boolean

Doc from java.util.ListIterator.hasPrevious.

true if the list iterator has more elements when traversing the list in the reverse direction

Annotations
@Override
isAfterLastback to summary
public boolean isAfterLast() throws DatabaseException

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

isBeforeFirstback to summary
public boolean isBeforeFirst() throws DatabaseException

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

isFirstback to summary
public boolean isFirst() throws DatabaseException

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

isLastback to summary
public boolean isLast() throws DatabaseException

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

lastback to summary
public boolean last() throws DatabaseException

PUBLIC: Moves the cursor to the last row in the result set

loadNextback to summary
protected void loadNext()

Load the next object

loadPreviousback to summary
protected void loadPrevious()

Load the previous object. This is used solely for scrollable cursor support

nextback to summary
public Object next() throws DatabaseException, QueryException

Implements java.util.ListIterator.next, java.util.Iterator.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

Returns:Object

- next object in stream

Annotations
@Override
Exceptions
DatabaseException:
if read pass end of stream
nextback to summary
public List<Object> next(int number) throws DatabaseException

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:int

- number of objects to be returned

Returns:List<Object>

- vector containing next number of objects

Exceptions
DatabaseException:
if read pass end of stream
nextElementback to summary
public Object nextElement() throws DatabaseException, QueryException

Implements java.util.Enumeration.nextElement.

PUBLIC: Return the next object from the collection, if beyond the read limit read from the cursor.

Returns:Object

next object in stream

Annotations
@Override
nextIndexback to summary
public int nextIndex() throws DatabaseException

Implements java.util.ListIterator.nextIndex.

PUBLIC: Retrieves the next row index (against the current row)

Returns:int

Doc from java.util.ListIterator.nextIndex.

the index of the element that would be returned by a subsequent call to next, or list size if the list iterator is at the end of the list

Annotations
@Override
previousback to summary
public Object previous() throws DatabaseException, QueryException

Implements java.util.ListIterator.previous.

PUBLIC: Return the previous object from the collection.

Returns:Object

- previous object in stream

Annotations
@Override
Exceptions
DatabaseException:
if read pass first of stream
previousIndexback to summary
public int previousIndex() throws DatabaseException

Implements java.util.ListIterator.previousIndex.

PUBLIC: Retrieves the previous row index (against the current row)

Returns:int

Doc from java.util.ListIterator.previousIndex.

the index of the element that would be returned by a subsequent call to previous, or -1 if the list iterator is at the beginning of the list

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

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

retrieveNextObjectback to summary
protected Object retrieveNextObject() throws DatabaseException

Implements abstract org.eclipse.persistence.queries.Cursor.retrieveNextObject.

INTERNAL: Read the next row from the result set.

Annotations
@Override
retrievePreviousObjectback to summary
protected Object retrievePreviousObject() throws DatabaseException

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

setback to summary
public void set(Object object) throws QueryException

Implements java.util.ListIterator.set.

PUBLIC: Set is not supported for scrollable cursors.

Parameters
object:Object

Doc from java.util.ListIterator.set.

the element with which to replace the last element returned by next or previous

Annotations
@Override
setNextObjectback to summary
protected void setNextObject(Object nextObject)
setPreviousObjectback to summary
protected void setPreviousObject(Object previousObject)