Top Description Fields Constructors Methods
com.mysql.cj.xdevapi

public Class SqlMultiResult

extends Object
implements SqlResult, ResultStreamer
Class Inheritance
All Implemented Interfaces
com.mysql.cj.protocol.ResultStreamer, com.mysql.cj.xdevapi.SqlResult, com.mysql.cj.xdevapi.RowResult, com.mysql.cj.xdevapi.Result, com.mysql.cj.QueryResult, com.mysql.cj.xdevapi.FetchResult, java.lang.Iterable, java.util.Iterator, com.mysql.cj.xdevapi.InsertResult
Imports
java.util.ArrayList, .Iterator, .List, java.util.function.Supplier, com.mysql.cj.exceptions.WrongArgumentException, com.mysql.cj.protocol.ResultStreamer

SqlResult representing a multiple result sets.

Field Summary

Modifier and TypeField and Description
private SqlResult
private List<SqlResult>
private Supplier<SqlResult>

Constructor Summary

AccessConstructor and Description
public
SqlMultiResult(Supplier<SqlResult>
Supplies the result stream depending on query type. Could be SqlSingleResult, SqlUpdateResult etc.
resultStream
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public long
count()

Implements com.mysql.cj.xdevapi.FetchResult.count.

How many items are in this result?

public List<Row>
fetchAll()

Implements com.mysql.cj.xdevapi.FetchResult.fetchAll.

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

public void
public long
getAffectedItemsCount()

Implements com.mysql.cj.xdevapi.Result.getAffectedItemsCount.

Get the count of affected items from manipulation statements.

public Long
getAutoIncrementValue()

Overrides default com.mysql.cj.xdevapi.SqlResult.getAutoIncrementValue.

Get the auto-increment value if one was generated from a row insert statement.

public int
public List<String>
public List<Column>
private SqlResult
public Iterator<Warning>
getWarnings()

Implements com.mysql.cj.xdevapi.Result.getWarnings.

Get warnings generated during statement execution.

public int
getWarningsCount()

Implements com.mysql.cj.xdevapi.Result.getWarningsCount.

Get the number of warnings generated during statement execution.

public boolean
hasData()

Overrides default com.mysql.cj.xdevapi.FetchResult.hasData.

Does this result have data?

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public Row
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public boolean
nextResult()

Overrides default com.mysql.cj.xdevapi.SqlResult.nextResult.

Move to the next result.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentResultback to summary
private SqlResult currentResult
pendingResultsback to summary
private List<SqlResult> pendingResults
resultStreamback to summary
private Supplier<SqlResult> resultStream

Constructor Detail

SqlMultiResultback to summary
public SqlMultiResult(Supplier<SqlResult> resultStream)

Constructor.

Parameters
resultStream:Supplier<SqlResult>

Supplies the result stream depending on query type. Could be SqlSingleResult, SqlUpdateResult etc.

Method Detail

countback to summary
public long count()

Implements com.mysql.cj.xdevapi.FetchResult.count.

Doc from com.mysql.cj.xdevapi.FetchResult.count.

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

Returns:long

number of elements in result

Annotations
@Override
fetchAllback to summary
public List<Row> fetchAll()

Implements com.mysql.cj.xdevapi.FetchResult.fetchAll.

Doc from com.mysql.cj.xdevapi.FetchResult.fetchAll.

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

Returns:List<Row>

list of result elements

Annotations
@Override
finishStreamingback to summary
public void finishStreaming()

Implements com.mysql.cj.protocol.ResultStreamer.finishStreaming.

Doc from com.mysql.cj.protocol.ResultStreamer.finishStreaming.

Finish the result streaming. This happens if a new command is started or the warnings/etc are requested. This is safe to call multiple times and only has an effect the first time.

Annotations
@Override
getAffectedItemsCountback to summary
public long getAffectedItemsCount()

Implements com.mysql.cj.xdevapi.Result.getAffectedItemsCount.

Doc from com.mysql.cj.xdevapi.Result.getAffectedItemsCount.

Get the count of affected items from manipulation statements. This method forces internal buffering of the result.

Returns:long

count

Annotations
@Override
getAutoIncrementValueback to summary
public Long getAutoIncrementValue()

Overrides default com.mysql.cj.xdevapi.SqlResult.getAutoIncrementValue.

Doc from com.mysql.cj.xdevapi.InsertResult.getAutoIncrementValue.

Get the auto-increment value if one was generated from a row insert statement.

Returns:Long

auto-increment value

Annotations
@Override
getColumnCountback to summary
public int getColumnCount()

Implements com.mysql.cj.xdevapi.RowResult.getColumnCount.

Doc from com.mysql.cj.xdevapi.RowResult.getColumnCount.

Count of columns.

Returns:int

count

Annotations
@Override
getColumnNamesback to summary
public List<String> getColumnNames()

Implements com.mysql.cj.xdevapi.RowResult.getColumnNames.

Doc from com.mysql.cj.xdevapi.RowResult.getColumnNames.

Names of columns.

Returns:List<String>

list of result column names

Annotations
@Override
getColumnsback to summary
public List<Column> getColumns()

Implements com.mysql.cj.xdevapi.RowResult.getColumns.

Doc from com.mysql.cj.xdevapi.RowResult.getColumns.

Metadata.

Returns:List<Column>

list of result Column objects

Annotations
@Override
getCurrentResultback to summary
private SqlResult getCurrentResult()
getWarningsback to summary
public Iterator<Warning> getWarnings()

Implements com.mysql.cj.xdevapi.Result.getWarnings.

Doc from com.mysql.cj.xdevapi.Result.getWarnings.

Get warnings generated during statement execution. This method forces internal buffering of the result.

Returns:Iterator<Warning>

iterator over warnings

Annotations
@Override
getWarningsCountback to summary
public int getWarningsCount()

Implements com.mysql.cj.xdevapi.Result.getWarningsCount.

Doc from com.mysql.cj.xdevapi.Result.getWarningsCount.

Get the number of warnings generated during statement execution. This method forces internal buffering of the result.

Returns:int

number of warnings

Annotations
@Override
hasDataback to summary
public boolean hasData()

Overrides default com.mysql.cj.xdevapi.FetchResult.hasData.

Doc from com.mysql.cj.xdevapi.FetchResult.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

Annotations
@Override
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public Row next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:Row

the next element in the iteration

Annotations
@Override
nextResultback to summary
public boolean nextResult()

Overrides default com.mysql.cj.xdevapi.SqlResult.nextResult.

Doc from com.mysql.cj.xdevapi.SqlResult.nextResult.

Move to the next result. This method has no effect after returning false for the first time.

Returns:boolean

was there a next result that we moved to?

Annotations
@Override