Package com.mysql.cj.xdevapi
Class SqlMultiResult
java.lang.Object
com.mysql.cj.xdevapi.SqlMultiResult
- All Implemented Interfaces:
ResultStreamer,QueryResult,FetchResult<Row>,InsertResult,Result,RowResult,SqlResult,java.lang.Iterable<Row>,java.util.Iterator<Row>
public class SqlMultiResult extends java.lang.Object implements SqlResult, ResultStreamer
SqlResult representing a multiple result sets.-
Constructor Summary
Constructors Constructor Description SqlMultiResult(java.util.function.Supplier<SqlResult> resultStream)Constructor. -
Method Summary
Modifier and Type Method Description longcount()How many items are in this result? This method forces internal buffering of the entire result.java.util.List<Row>fetchAll()Create a list of all elements in the result forcing internal buffering.voidfinishStreaming()Finish the result streaming.longgetAffectedItemsCount()Get the count of affected items from manipulation statements.java.lang.LonggetAutoIncrementValue()Get the auto-increment value if one was generated from a row insert statement.intgetColumnCount()Count of columns.java.util.List<java.lang.String>getColumnNames()Names of columns.java.util.List<Column>getColumns()Metadata.java.util.Iterator<Warning>getWarnings()Get warnings generated during statement execution.intgetWarningsCount()Get the number of warnings generated during statement execution.booleanhasData()Does this result have data? This indicates that the result was produced from a data-returning query.booleanhasNext()Rownext()booleannextResult()Move to the next result.
-
Constructor Details
-
SqlMultiResult
Constructor.- Parameters:
resultStream- Supplies the result stream depending on query type. Could beSqlSingleResult,SqlUpdateResultetc.
-
-
Method Details
-
nextResult
public boolean nextResult()Description copied from interface:SqlResultMove to the next result. This method has no effect after returningfalsefor the first time.- Specified by:
nextResultin interfaceSqlResult- Returns:
- was there a next result that we moved to?
-
finishStreaming
public void finishStreaming()Description copied from interface:ResultStreamerFinish 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.- Specified by:
finishStreamingin interfaceResultStreamer
-
hasData
public boolean hasData()Description copied from interface:FetchResultDoes 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.- Specified by:
hasDatain interfaceFetchResult<Row>- Returns:
- true if has data
-
getAffectedItemsCount
public long getAffectedItemsCount()Description copied from interface:ResultGet the count of affected items from manipulation statements. This method forces internal buffering of the result.- Specified by:
getAffectedItemsCountin interfaceResult- Returns:
- count
-
getAutoIncrementValue
public java.lang.Long getAutoIncrementValue()Description copied from interface:InsertResultGet the auto-increment value if one was generated from a row insert statement.- Specified by:
getAutoIncrementValuein interfaceInsertResult- Specified by:
getAutoIncrementValuein interfaceSqlResult- Returns:
- auto-increment value
-
getWarningsCount
public int getWarningsCount()Description copied from interface:ResultGet the number of warnings generated during statement execution. This method forces internal buffering of the result.- Specified by:
getWarningsCountin interfaceResult- Returns:
- number of warnings
-
getWarnings
Description copied from interface:ResultGet warnings generated during statement execution. This method forces internal buffering of the result.- Specified by:
getWarningsin interfaceResult- Returns:
- iterator over warnings
-
getColumnCount
public int getColumnCount()Description copied from interface:RowResultCount of columns.- Specified by:
getColumnCountin interfaceRowResult- Returns:
- count
-
getColumns
Description copied from interface:RowResultMetadata.- Specified by:
getColumnsin interfaceRowResult- Returns:
- list of result
Columnobjects
-
getColumnNames
public java.util.List<java.lang.String> getColumnNames()Description copied from interface:RowResultNames of columns.- Specified by:
getColumnNamesin interfaceRowResult- Returns:
- list of result column names
-
count
public long count()Description copied from interface:FetchResultHow many items are in this result? This method forces internal buffering of the entire result.- Specified by:
countin interfaceFetchResult<Row>- Returns:
- number of elements in result
-
fetchAll
Description copied from interface:FetchResultCreate a list of all elements in the result forcing internal buffering.- Specified by:
fetchAllin interfaceFetchResult<Row>- Returns:
- list of result elements
-
next
- Specified by:
nextin interfacejava.util.Iterator<Row>
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacejava.util.Iterator<Row>
-