Class DefaultCursor<T>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<T>, Cursor<T>

    public class DefaultCursor<T>
    extends java.lang.Object
    implements Cursor<T>
    This is the default implementation of a MyBatis Cursor. This implementation is not thread safe.
    Author:
    Guillaume Darmont / guillaume@dropinocean.com
    • Method Detail

      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface Cursor<T>
        Returns:
        true if the cursor has started to fetch items from database.
      • isConsumed

        public boolean isConsumed()
        Specified by:
        isConsumed in interface Cursor<T>
        Returns:
        true if the cursor is fully consumed and has returned all elements matching the query.
      • getCurrentIndex

        public int getCurrentIndex()
        Description copied from interface: Cursor
        Get the current item index. The first item has the index 0.
        Specified by:
        getCurrentIndex in interface Cursor<T>
        Returns:
        -1 if the first cursor item has not been retrieved. The index of the current item retrieved.
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • fetchNextUsingRowBound

        protected T fetchNextUsingRowBound()
      • fetchNextObjectFromDatabase

        protected T fetchNextObjectFromDatabase()