Class DefaultCursor<T>
java.lang.Object
org.apache.ibatis.cursor.defaults.DefaultCursor<T>
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<T>
,Cursor<T>
This is the default implementation of a MyBatis Cursor.
This implementation is not thread safe.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
private static enum
protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DefaultCursor<T>.CursorIterator
private int
private boolean
protected final DefaultCursor.ObjectWrapperResultHandler
<T> private final ResultMap
private final DefaultResultSetHandler
private final RowBounds
private final ResultSetWrapper
private DefaultCursor.CursorStatus
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCursor
(DefaultResultSetHandler resultSetHandler, ResultMap resultMap, ResultSetWrapper rsw, RowBounds rowBounds) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
resultSetHandler
-
resultMap
-
rsw
-
rowBounds
-
objectWrapperResultHandler
-
cursorIterator
-
iteratorRetrieved
private boolean iteratorRetrieved -
status
-
indexWithRowBound
private int indexWithRowBound
-
-
Constructor Details
-
DefaultCursor
public DefaultCursor(DefaultResultSetHandler resultSetHandler, ResultMap resultMap, ResultSetWrapper rsw, RowBounds rowBounds)
-
-
Method Details
-
isOpen
public boolean isOpen() -
isConsumed
public boolean isConsumed()- Specified by:
isConsumed
in interfaceCursor<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 interfaceCursor<T>
- Returns:
- -1 if the first cursor item has not been retrieved. The index of the current item retrieved.
-
iterator
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
fetchNextUsingRowBound
-
fetchNextObjectFromDatabase
-
isClosed
private boolean isClosed() -
getReadItemsCount
private int getReadItemsCount()
-