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
    long count()
    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.
    void finishStreaming()
    Finish the result streaming.
    long getAffectedItemsCount()
    Get the count of affected items from manipulation statements.
    java.lang.Long getAutoIncrementValue()
    Get the auto-increment value if one was generated from a row insert statement.
    int getColumnCount()
    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.
    int getWarningsCount()
    Get the number of warnings generated during statement execution.
    boolean hasData()
    Does this result have data? This indicates that the result was produced from a data-returning query.
    boolean hasNext()  
    Row next()  
    boolean nextResult()
    Move to the next result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.mysql.cj.xdevapi.FetchResult

    fetchOne, iterator

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Constructor Details

  • Method Details

    • nextResult

      public boolean nextResult()
      Description copied from interface: SqlResult
      Move to the next result. This method has no effect after returning false for the first time.
      Specified by:
      nextResult in interface SqlResult
      Returns:
      was there a next result that we moved to?
    • finishStreaming

      public void finishStreaming()
      Description copied from interface: ResultStreamer
      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.
      Specified by:
      finishStreaming in interface ResultStreamer
    • hasData

      public boolean hasData()
      Description copied from interface: FetchResult
      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.
      Specified by:
      hasData in interface FetchResult<Row>
      Returns:
      true if has data
    • getAffectedItemsCount

      public long getAffectedItemsCount()
      Description copied from interface: Result
      Get the count of affected items from manipulation statements. This method forces internal buffering of the result.
      Specified by:
      getAffectedItemsCount in interface Result
      Returns:
      count
    • getAutoIncrementValue

      public java.lang.Long getAutoIncrementValue()
      Description copied from interface: InsertResult
      Get the auto-increment value if one was generated from a row insert statement.
      Specified by:
      getAutoIncrementValue in interface InsertResult
      Specified by:
      getAutoIncrementValue in interface SqlResult
      Returns:
      auto-increment value
    • getWarningsCount

      public int getWarningsCount()
      Description copied from interface: Result
      Get the number of warnings generated during statement execution. This method forces internal buffering of the result.
      Specified by:
      getWarningsCount in interface Result
      Returns:
      number of warnings
    • getWarnings

      public java.util.Iterator<Warning> getWarnings()
      Description copied from interface: Result
      Get warnings generated during statement execution. This method forces internal buffering of the result.
      Specified by:
      getWarnings in interface Result
      Returns:
      iterator over warnings
    • getColumnCount

      public int getColumnCount()
      Description copied from interface: RowResult
      Count of columns.
      Specified by:
      getColumnCount in interface RowResult
      Returns:
      count
    • getColumns

      public java.util.List<Column> getColumns()
      Description copied from interface: RowResult
      Metadata.
      Specified by:
      getColumns in interface RowResult
      Returns:
      list of result Column objects
    • getColumnNames

      public java.util.List<java.lang.String> getColumnNames()
      Description copied from interface: RowResult
      Names of columns.
      Specified by:
      getColumnNames in interface RowResult
      Returns:
      list of result column names
    • count

      public long count()
      Description copied from interface: FetchResult
      How many items are in this result? This method forces internal buffering of the entire result.
      Specified by:
      count in interface FetchResult<Row>
      Returns:
      number of elements in result
    • fetchAll

      public java.util.List<Row> fetchAll()
      Description copied from interface: FetchResult
      Create a list of all elements in the result forcing internal buffering.
      Specified by:
      fetchAll in interface FetchResult<Row>
      Returns:
      list of result elements
    • next

      public Row next()
      Specified by:
      next in interface java.util.Iterator<Row>
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<Row>