Top Fields Constructors Methods
org.jooq.impl

pack-priv final Class ResultAsCursor<R extends org.jooq.Record>

extends AbstractCursor<R extends Record>
Class Inheritance
Imports
java.sql.ResultSet, java.util.Iterator, .List, org.jooq.Attachable, .Record, .Result

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private int
private final Result<R>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.jooq.Cursor.close.

Explicitly close the underlying PreparedStatement and ResultSet.
public final Result<R>
fetchNext(int
The number of records to fetch. If this is 0 or negative an empty list is returned, the cursor is untouched. If this is greater than the number of remaining records, then all remaining records are returned.
number
)

Implements org.jooq.Cursor.fetchNext.

Fetch the next couple of records from the cursor.
pack-priv final List<? extends Attachable>
public boolean
isClosed()

Implements org.jooq.Cursor.isClosed.

Check whether this Cursor has been explicitly or "conveniently" closed.
public final Iterator<R>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public final ResultSet
resultSet()

Implements org.jooq.Cursor.resultSet.

Get the Cursor's underlying ResultSet.
Inherited from org.jooq.impl.AbstractCursor:
collectfetchfetchfetchfetchIntofetchIntofetchIntofetchNextfetchNextfetchNextIntofetchNextIntofetchNextIntofetchNextOptionalfetchNextOptionalfetchNextOptionalIntofetchNextOptionalIntofetchOnefetchOnefetchOneIntofetchOneIntofetchOneIntofetchOptionalfetchOptionalfetchOptionalIntofetchOptionalIntohasNextstream

Field Detail

indexback to summary
private int index
resultback to summary
private final Result<R> result

Constructor Detail

ResultAsCursorback to summary
pack-priv ResultAsCursor(Result<R> result)
Annotations
@SuppressWarnings:unchecked

Method Detail

closeback to summary
public void close()

Implements org.jooq.Cursor.close.

Doc from org.jooq.Cursor.close.

Explicitly close the underlying PreparedStatement and ResultSet.

If you fetch all records from the underlying ResultSet, jOOQ Cursor implementations will close themselves for you. Calling close() again will have no effect.

Annotations
@Override
fetchNextback to summary
public final Result<R> fetchNext(int number)

Implements org.jooq.Cursor.fetchNext.

Doc from org.jooq.Cursor.fetchNext.

Fetch the next couple of records from the cursor.

This will conveniently close the Cursor, after the last Record was fetched.

The result and its contained records are attached to the original Configuration by default. Use Settings#isAttachRecords() to override this behaviour.

Parameters
number:int

The number of records to fetch. If this is 0 or negative an empty list is returned, the cursor is untouched. If this is greater than the number of remaining records, then all remaining records are returned.

Annotations
@Override
getAttachablesback to summary
pack-priv final List<? extends Attachable> getAttachables()

Implements abstract org.jooq.impl.AbstractFormattable.getAttachables.

Annotations
@Override
isClosedback to summary
public boolean isClosed()

Implements org.jooq.Cursor.isClosed.

Doc from org.jooq.Cursor.isClosed.

Check whether this Cursor has been explicitly or "conveniently" closed.

Explicit closing can be achieved by calling close() from client code. "Convenient" closing is done by any of the other methods, when the last record was fetched.

Annotations
@Override
iteratorback to summary
public final Iterator<R> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<R>

an Iterator.

Annotations
@Override
resultSetback to summary
public final ResultSet resultSet()

Implements org.jooq.Cursor.resultSet.

Doc from org.jooq.Cursor.resultSet.

Get the Cursor's underlying ResultSet.

This will return a ResultSet wrapping the JDBC driver's ResultSet. Closing this ResultSet may close the producing Statement or PreparedStatement, depending on your setting for ResultQuery#keepStatement(boolean).

Modifying this ResultSet will affect this Cursor.

Returns:ResultSet

The underlying ResultSet. May be null, for instance when the Cursor is closed.

Annotations
@Override