Class DefaultCursor<T>

All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<T>, Cursor<T>

public class DefaultCursor<T> extends Object implements Cursor<T>
This is the default implementation of a MyBatis Cursor. This implementation is not thread safe.
Guillaume Darmont /
  • Field Details

  • Constructor Details

  • Method Details

    • isOpen

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

      public boolean isConsumed()
      Specified by:
      isConsumed in interface Cursor<T>
      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>
      -1 if the first cursor item has not been retrieved. The index of the current item retrieved.
    • iterator

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

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • fetchNextUsingRowBound

      protected T fetchNextUsingRowBound()
    • fetchNextObjectFromDatabase

      protected T fetchNextObjectFromDatabase()