Class ScrollableCursor

    • Field Detail

      • nextObject

        protected transient Object nextObject
      • previousObject

        protected transient Object previousObject
      • previousRow

        protected org.eclipse.persistence.internal.sessions.AbstractRecord previousRow
        Store the previous row, for 1-m joining.
      • atEndOfCursor

        protected boolean atEndOfCursor
        Internal flag indicating if the end of the cursor has been reached
    • Constructor Detail

      • ScrollableCursor

        public ScrollableCursor()
        INTERNAL: Default constructor.
      • ScrollableCursor

        public ScrollableCursor​(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call,
                                ScrollableCursorPolicy policy)
        INTERNAL: constructor.
    • Method Detail

      • beforeFirst

        public void beforeFirst()
                         throws DatabaseException
        PUBLIC: Moves the cursor to the front of the result set, just before the first row
        Throws:
        DatabaseException
      • clearNextAndPrevious

        protected void clearNextAndPrevious()
        INTERNAL: Clear the cached next and previous object and row values. This must be called whenever the cursor is re-positioned.
      • clearNextAndPreviousObject

        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.
      • getKnownCursorSize

        protected int getKnownCursorSize()
      • getNextObject

        protected Object getNextObject()
      • getPosition

        public int getPosition()
                        throws DatabaseException
        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.
        Specified by:
        getPosition in class Cursor
        Returns:
        the current row number; 0 if there is no current row
        Throws:
        DatabaseException - if a database access error occurs
      • getPreviousObject

        protected Object getPreviousObject()
      • isAfterLast

        public boolean isAfterLast()
                            throws DatabaseException
        PUBLIC: Indicates whether the cursor is after the last row in the result set.
        Throws:
        DatabaseException
      • isBeforeFirst

        public boolean isBeforeFirst()
                              throws DatabaseException
        PUBLIC: Indicates whether the cursor is before the first row in the result set.
        Throws:
        DatabaseException
      • loadNext

        protected void loadNext()
        Load the next object
      • loadPrevious

        protected void loadPrevious()
        Load the previous object. This is used solely for scrollable cursor support
      • 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:
        next in interface Iterator
        Specified by:
        next in interface ListIterator
        Returns:
        - next object in stream
        Throws:
        DatabaseException - if read pass end of stream
        QueryException
      • 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
      • relative

        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
        Throws:
        DatabaseException
      • retrievePreviousObject

        protected Object retrievePreviousObject()
                                         throws DatabaseException
        INTERNAL: CR#4139 Read the previous row from the result set. It is used solely for scrollable cursor support.
        Throws:
        DatabaseException
      • setNextObject

        protected void setNextObject​(Object nextObject)
      • setPreviousObject

        protected void setPreviousObject​(Object previousObject)