Interface Cursor<T>

All Superinterfaces:
AutoCloseable, Closeable, Iterable<T>
All Known Implementing Classes:

public interface Cursor<T> extends Closeable, Iterable<T>
Cursor contract to handle fetching items lazily using an Iterator. Cursors are a perfect fit to handle millions of items queries that would not normally fit in memory. If you use collections in resultMaps then cursor SQL queries must be ordered (resultOrdered="true") using the id columns of the resultMap.
Guillaume Darmont /
  • Method Details

    • isOpen

      boolean isOpen()
      true if the cursor has started to fetch items from database.
    • isConsumed

      boolean isConsumed()
      true if the cursor is fully consumed and has returned all elements matching the query.
    • getCurrentIndex

      int getCurrentIndex()
      Get the current item index. The first item has the index 0.
      -1 if the first cursor item has not been retrieved. The index of the current item retrieved.