ResultSet. Unlike Result, data can only be accessed
sequentially, using an Iterator, or the cursor's hasNext()
and fetch() methods.
Client code must close this Cursor in order to close the underlying
PreparedStatement and ResultSet
The cursor can be consumed in two ways:
fetchNext(int).fetch().| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Redeclares java. PreparedStatement and
ResultSet.
|
| public <X, A> X | |
| public @NotNull Result | |
| public @NotNull Result | |
| public <E> @NotNull List | Returns: The custom mapped recordsThe mapper callback mapper)Fetch results into a custom mapper callback. |
| public <H extends RecordHandler | Returns: Convenience result, returning the parameter handler itselfThe handler callback handler)
Deprecated
for removal since 3.15. - 3.15.0 - [#11902] - Use
Fetch results into a custom handler callback.
Iterable#forEach(Consumer)
based methods, instead.
|
| public < The generic entity type. E> @NotNull List | |
| public < The generic table record type. Z extends Record> @NotNull Result | |
| public @NotNull Result | fetchNext(int
The number of records to fetch. If this is number)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.Fetch the next couple of records from the cursor. |
| public R | Returns: The next record from the cursor, ornull if there is
no next record.Fetch the next record from the cursor. |
| public <E> E | Returns: The custom mapped recordThe mapper callback mapper)Fetch the next record into a custom mapper callback. |
| public <H extends RecordHandler | Returns: Convenience result, returning the parameter handler itselfThe handler callback handler)
Deprecated
for removal since 3.15. - 3.15.0 - [#11902] - Use
Fetch the next record into a custom handler callback.
Iterable#forEach(Consumer)
based methods, instead.
|
| public < The generic entity type. E> E | fetchNextInto(Class<? extends E>
The entity type. type)Map the next resulting record onto a custom type. |
| public < The generic table record type. Z extends Record> Z | |
| public @NotNull Optional | |
| public <E> @NotNull Optional | Returns: The custom mapped recordThe mapper callback mapper)Fetch the next record into a custom mapper callback. |
| public < The generic entity type. E> @NotNull Optional | fetchNextOptionalInto(Class<? extends E>
The entity type. type)Map the next resulting record onto a custom type. |
| public < The generic table record type. Z extends Record> @NotNull Optional | fetchNextOptionalInto(Table<Z>
The table type. table)Map the next resulting record onto a custom record. |
| public R | |
| public <E> E | fetchOne(RecordMapper<? super R, E> mapper)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNext(RecordMapper) instead.
|
| public <H extends RecordHandler | fetchOneInto(H handler)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextInto(RecordHandler) instead.
Deprecated
for removal since 3.10. - 3.15.0 - [#11902] - Use
Iterable#forEach(Consumer)
based methods, instead.
|
| public <Z extends Record> Z | fetchOneInto(Table<Z> table)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextInto(Table) instead.
|
| public <E> E | fetchOneInto(Class<? extends E> type)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextInto(Class) instead.
|
| public @NotNull Optional | fetchOptional()
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextOptional() instead.
|
| public <E> @NotNull Optional | fetchOptional(RecordMapper<? super R, E> mapper)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextOptional(RecordMapper) instead.
|
| public <E> @NotNull Optional | fetchOptionalInto(Class<? extends E> type)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextOptionalInto(Class) instead.
|
| public <Z extends Record> @NotNull Optional | fetchOptionalInto(Table<Z> table)
Deprecated
for removal since 3.10. - 3.10 - [#6363] - Use
fetchNextOptionalInto(Table) instead.
|
| public boolean | |
| public boolean | |
| public @NotNull RecordType | |
| public @Nullable ResultSet | |
| public @NotNull Stream |
| close | back to summary |
|---|---|
| public void close() throws DataAccessException Redeclares java. Explicitly close the underlying
If you fetch all records from the underlying
| |
| collect | back to summary |
|---|---|
| public <X, A> X collect(Collector<? super R, A, X> collector) throws DataAccessException Reduce the execution results of this query using a This works in the same way as calling the following code:
| |
| fetch | back to summary |
|---|---|
| public @NotNull Result Fetch all remaining records as a result.
This will conveniently close the
The result and its contained records are attached to the original
| |
| fetch | back to summary |
|---|---|
public @NotNull Result
| |
| fetch | back to summary |
|---|---|
| public <E> @NotNull List Fetch results into a custom mapper callback.
| |
| fetchInto | back to summary |
|---|---|
| public <H extends RecordHandler Deprecated for removal since 3.15. - 3.15.0 - [#11902] - Use Fetch results into a custom handler callback.
The resulting records are attached to the original
| |
| fetchInto | back to summary |
|---|---|
| public <E> @NotNull List Map resulting records onto a custom type.
This is the same as calling
| |
| fetchInto | back to summary |
|---|---|
| public <Z extends Record> @NotNull Result Map resulting records onto a custom record.
This is the same as calling
The result and its contained records are attached to the original
| |
| fetchNext | back to summary |
|---|---|
| public @NotNull Result Fetch the next couple of records from the cursor.
This will conveniently close the
The result and its contained records are attached to the original
| |
| fetchNext | back to summary |
|---|---|
| public R fetchNext() throws DataAccessException Fetch the next record from the cursor.
This will conveniently close the
The resulting record is attached to the original
| |
| fetchNext | back to summary |
|---|---|
| public <E> E fetchNext(RecordMapper<? super R, E> mapper) throws DataAccessException Fetch the next record into a custom mapper callback.
This will conveniently close the
| |
| fetchNextInto | back to summary |
|---|---|
| public <H extends RecordHandler Deprecated for removal since 3.15. - 3.15.0 - [#11902] - Use Fetch the next record into a custom handler callback.
This will conveniently close the
The resulting record is attached to the original
| |
| fetchNextInto | back to summary |
|---|---|
| public <E> E fetchNextInto(Class<? extends E> type) throws DataAccessException, MappingException Map the next resulting record onto a custom type.
This is the same as calling
| |
| fetchNextInto | back to summary |
|---|---|
| public <Z extends Record> Z fetchNextInto(Table<Z> table) throws DataAccessException, MappingException Map the next resulting record onto a custom record.
This is the same as calling
The resulting record is attached to the original
| |
| fetchNextOptional | back to summary |
|---|---|
| public @NotNull Optional Fetch the next record from the cursor.
This will conveniently close the
The resulting record is attached to the original
| |
| fetchNextOptional | back to summary |
|---|---|
| public <E> @NotNull Optional Fetch the next record into a custom mapper callback.
This will conveniently close the
| |
| fetchNextOptionalInto | back to summary |
|---|---|
| public <E> @NotNull Optional Map the next resulting record onto a custom type.
This is the same as calling
| |
| fetchNextOptionalInto | back to summary |
|---|---|
| public <Z extends Record> @NotNull Optional Map the next resulting record onto a custom record.
This is the same as calling
The resulting record is attached to the original
| |
| fetchOne | back to summary |
|---|---|
public R fetchOne() throws DataAccessException
| |
| fetchOne | back to summary |
|---|---|
public <E> E fetchOne(RecordMapper<? super R, E> mapper) throws DataAccessException
| |
| fetchOneInto | back to summary |
|---|---|
| public <H extends RecordHandler Deprecated for removal since 3.10. - 3.15.0 - [#11902] - Use
| |
| fetchOneInto | back to summary |
|---|---|
public <Z extends Record> Z fetchOneInto(Table<Z> table) throws DataAccessException, MappingException
| |
| fetchOneInto | back to summary |
|---|---|
public <E> E fetchOneInto(Class<? extends E> type) throws DataAccessException, MappingException
| |
| fetchOptional | back to summary |
|---|---|
public @NotNull Optional
| |
| fetchOptional | back to summary |
|---|---|
public <E> @NotNull Optional
| |
| fetchOptionalInto | back to summary |
|---|---|
public <E> @NotNull Optional
| |
| fetchOptionalInto | back to summary |
|---|---|
public <Z extends Record> @NotNull Optional
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() throws DataAccessException Check whether this cursor has a next record.
This will conveniently close the
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Check whether this
Explicit closing can be achieved by calling | |
| recordType | back to summary |
|---|---|
| public @NotNull RecordType Get this cursor's row type.
| |
| resultSet | back to summary |
|---|---|
| public @Nullable ResultSet resultSet() Get the
This will return a
Modifying this | |
| stream | back to summary |
|---|---|
| public @NotNull Stream Turn this
| |