public interface


implements Closeable Iterable<T>
Known Indirect Subclasses

Class Overview

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 fits in memory. Cursor SQL queries must be ordered (resultOrdered="true") using the id columns of the resultMap.


Public Methods
abstract int getCurrentIndex()
Get the current item index.
abstract boolean isConsumed()
abstract boolean isOpen()
Inherited Methods
From interface
From interface java.lang.AutoCloseable
From interface java.lang.Iterable

Public Methods

public abstract 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.

public abstract boolean isConsumed ()

  • true if the cursor is fully consumed and has returned all elements matching the query.

public abstract boolean isOpen ()

  • true if the cursor has started to fetch items from database.