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
public class ScrollableCursor extends Cursor implements ListIterator
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ScrollableCursor()INTERNAL: Default constructor.ScrollableCursor(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, ScrollableCursorPolicy policy)INTERNAL: constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabsolute(int rows)PUBLIC: Moves the cursor to the given row number in the result setvoidadd(Object object)PUBLIC: Add is not support for scrollable cursors.voidafterLast()PUBLIC: Moves the cursor to the end of the result set, just after the last row.voidbeforeFirst()PUBLIC: Moves the cursor to the front of the result set, just before the first rowintcurrentIndex()PUBLIC: Retrieves the current row index numberbooleanfirst()PUBLIC: Moves the cursor to the first row in the result setintgetPosition()PUBLIC: Retrieves the current cursor position (current row).booleanhasMoreElements()PUBLIC: Indicates whether the cursor can move to the the next rowbooleanhasNext()PUBLIC: Indicates whether the cursor can move to the the next rowbooleanhasNextElement()PUBLIC: Indicates whether the cursor can move to the the next rowbooleanhasPrevious()PUBLIC: Indicates whether the cursor can move to the the previous rowbooleanisAfterLast()PUBLIC: Indicates whether the cursor is after the last row in the result set.booleanisBeforeFirst()PUBLIC: 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 setObjectnext()PUBLIC: This method differs slightly from conventional read() operation on a Java stream.List<Object>next(int number)PUBLIC: This method differs slightly from conventional read() operation on a Java stream.ObjectnextElement()PUBLIC: Return the next object from the collection, if beyond the read limit read from the cursor.intnextIndex()PUBLIC: Retrieves the next row index (against the current row)Objectprevious()PUBLIC: Return the previous object from the collection.intpreviousIndex()PUBLIC: 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.voidset(Object object)PUBLIC: Set is not supported for scrollable cursors.-
Methods inherited from class org.eclipse.persistence.queries.Cursor
clear, close, getAccessor, getExecutionSession, getFields, getInitiallyConformingIndex, getObjectCollection, getPageSize, getPolicy, getQuery, getResultSet, getSelectionCriteriaClone, getSession, isClosed, remove, setInitiallyConformingIndex, setObjectCollection, setPolicy, setSelectionCriteriaClone, setSession, setSize, setTranslationRow, size
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Methods inherited from interface java.util.ListIterator
remove
-
-
-
-
Constructor Detail
-
ScrollableCursor
public ScrollableCursor()
INTERNAL: Default constructor.
-
ScrollableCursor
public ScrollableCursor(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, ScrollableCursorPolicy policy)INTERNAL: constructor.
-
-
Method Detail
-
absolute
public boolean absolute(int rows) throws DatabaseExceptionPUBLIC: Moves the cursor to the given row number in the result set- Throws:
DatabaseException
-
add
public void add(Object object) throws QueryException
PUBLIC: Add is not support for scrollable cursors.- Specified by:
addin interfaceListIterator- Throws:
QueryException
-
afterLast
public void afterLast() throws DatabaseExceptionPUBLIC: Moves the cursor to the end of the result set, just after the last row.- Throws:
DatabaseException
-
beforeFirst
public void beforeFirst() throws DatabaseExceptionPUBLIC: Moves the cursor to the front of the result set, just before the first row- Throws:
DatabaseException
-
currentIndex
public int currentIndex() throws DatabaseExceptionPUBLIC: Retrieves the current row index number- Throws:
DatabaseException
-
first
public boolean first() throws DatabaseExceptionPUBLIC: Moves the cursor to the first row in the result set- Throws:
DatabaseException
-
getPosition
public int getPosition() throws DatabaseExceptionPUBLIC: 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
-
hasMoreElements
public boolean hasMoreElements() throws DatabaseExceptionPUBLIC: Indicates whether the cursor can move to the the next row- Specified by:
hasMoreElementsin interfaceEnumeration- Throws:
DatabaseException
-
hasNext
public boolean hasNext() throws DatabaseExceptionPUBLIC: Indicates whether the cursor can move to the the next row- Specified by:
hasNextin interfaceIterator- Specified by:
hasNextin interfaceListIterator- Throws:
DatabaseException
-
hasNextElement
public boolean hasNextElement() throws DatabaseExceptionPUBLIC: Indicates whether the cursor can move to the the next row- Throws:
DatabaseException
-
hasPrevious
public boolean hasPrevious() throws DatabaseExceptionPUBLIC: Indicates whether the cursor can move to the the previous row- Specified by:
hasPreviousin interfaceListIterator- Throws:
DatabaseException
-
isAfterLast
public boolean isAfterLast() throws DatabaseExceptionPUBLIC: Indicates whether the cursor is after the last row in the result set.- Throws:
DatabaseException
-
isBeforeFirst
public boolean isBeforeFirst() throws DatabaseExceptionPUBLIC: Indicates whether the cursor is before the first row in the result set.- Throws:
DatabaseException
-
isFirst
public boolean isFirst() throws DatabaseExceptionPUBLIC: Indicates whether the cursor is on the first row of the result set.- Throws:
DatabaseException
-
isLast
public boolean isLast() throws DatabaseExceptionPUBLIC: Indicates whether the cursor is on the last row of the result set.- Throws:
DatabaseException
-
last
public boolean last() throws DatabaseExceptionPUBLIC: Moves the cursor to the last row in the result set- Throws:
DatabaseException
-
next
public Object next() throws DatabaseException, QueryException
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 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- - number of objects to be returned- Returns:
- - vector containing next number of objects
- Throws:
DatabaseException- if read pass end of stream
-
nextElement
public Object nextElement() throws DatabaseException, QueryException
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 int nextIndex() throws DatabaseExceptionPUBLIC: Retrieves the next row index (against the current row)- Specified by:
nextIndexin interfaceListIterator- Throws:
DatabaseException
-
previous
public Object previous() throws DatabaseException, QueryException
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 int previousIndex() throws DatabaseExceptionPUBLIC: Retrieves the previous row index (against the current row)- Specified by:
previousIndexin interfaceListIterator- Throws:
DatabaseException
-
relative
public boolean relative(int rows) throws DatabaseExceptionPUBLIC: 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
-
set
public void set(Object object) throws QueryException
PUBLIC: Set is not supported for scrollable cursors.- Specified by:
setin interfaceListIterator- Throws:
QueryException
-
-