Top Description Methods
com.mysql.cj.xdevapi

public Interface FetchResult<T>

extends Iterator<T>, Iterable<T>
Known Direct Subinterfaces
com.mysql.cj.xdevapi.RowResult, com.mysql.cj.xdevapi.DocResult
Type Parameters
<T>
the type of element returned from the query (doc or row)
Imports
java.util.Iterator, .List

A set of elements from a query command.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

number of elements in result
count
()

How many items are in this result?

public List<T>

Returns:

list of result elements
fetchAll
()

Create a list of all elements in the result forcing internal buffering.

public default T

Returns:

element of type T
fetchOne
()

Fetch the next element.

public default boolean

Returns:

true if has data
hasData
()

Does this result have data?

public default Iterator<T>

Returns:

iterator over result items
iterator
()

Implements java.lang.Iterable.iterator.

Create an iterator over all elements of the result.

Inherited from java.lang.Iterable:
forEachspliterator
Inherited from java.util.Iterator:
forEachRemaininghasNextnextremove

Method Detail

countback to summary
public long count()

How many items are in this result? This method forces internal buffering of the entire result.

Returns:long

number of elements in result

fetchAllback to summary
public List<T> fetchAll()

Create a list of all elements in the result forcing internal buffering.

Returns:List<T>

list of result elements

fetchOneback to summary
public default T fetchOne()

Fetch the next element.

Returns:T

element of type T

hasDataback to summary
public default boolean hasData()

Does this result have data? This indicates that the result was produced from a data-returning query. It does not indicate whether there are more than 0 rows in the result.

Returns:boolean

true if has data

iteratorback to summary
public default Iterator<T> iterator()

Implements java.lang.Iterable.iterator.

Create an iterator over all elements of the result.

Returns:Iterator<T>

iterator over result items

Annotations
@Override