public interface

Cursor

implements Closeable Iterable<T>
org.apache.ibatis.cursor.Cursor<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.

Summary

Public Methods
abstract int getCurrentIndex()
Get the current item index.
abstract boolean isConsumed()
abstract boolean isOpen()
[Expand]
Inherited Methods
From interface java.io.Closeable
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.

Returns
  • -1 if the first cursor item has not been retrieved. The index of the current item retrieved.

public abstract boolean isConsumed ()

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

public abstract boolean isOpen ()

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