Class QueryResultRowSet

java.lang.Object
nl.cwi.monetdb.embedded.mapping.AbstractRowSet
nl.cwi.monetdb.embedded.resultset.QueryResultRowSet
All Implemented Interfaces:
java.lang.Iterable

public class QueryResultRowSet
extends AbstractRowSet
implements java.lang.Iterable
The row result set from a sendQuery.
  • Field Summary

    Fields inherited from class nl.cwi.monetdb.embedded.mapping.AbstractRowSet

    mappings, rows
  • Method Summary

    Modifier and Type Method Description
    MonetDBRow[] getAllRows()
    Gets all rows of this set.
    <T> T[] getColumnByIndex​(int column)
    Gets a column in this set as a Java class using the default mapping.
    <T> T[] getColumnByIndex​(int column, java.lang.Class<T> javaClass)
    Gets a column in this set as a Java class.
    <T> T[] getColumnByName​(java.lang.String columnName)
    Gets a column in this set as a Java class using the default mapping.
    <T> T[] getColumnByName​(java.lang.String columnName, java.lang.Class<T> javaClass)
    Gets a column in this set as a Java class.
    int getColumnIndexByName​(java.lang.String columnName)
    Gets a column index in the result set by name.
    int getNumberOfRows()
    Gets the number of rows in this set.
    MonetDBRow getSingleRow​(int row)
    Gets a single row in this set.
    <T> T getSingleValueByIndex​(int row, int column)
    Gets a single value in this set as a Java class using the default mapping.
    <T> T getSingleValueByIndex​(int row, int column, java.lang.Class<T> javaClass)
    Gets a single value in this set as a Java class.
    <T> T getSingleValueByName​(int row, java.lang.String columnName)
    Gets a single value in this set as a Java class using the default mapping.
    <T> T getSingleValueByName​(int row, java.lang.String columnName, java.lang.Class<T> javaClass)
    Gets a single value in this set as a Java class.
    java.util.ListIterator<MonetDBRow> iterator()  

    Methods inherited from class nl.cwi.monetdb.embedded.mapping.AbstractRowSet

    getNumberOfColumns, getQueryResultTable

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • getAllRows

      public MonetDBRow[] getAllRows()
      Gets all rows of this set.
      Returns:
      All rows of this set
    • getNumberOfRows

      public int getNumberOfRows()
      Gets the number of rows in this set.
      Returns:
      The number of rows in this set
    • getSingleRow

      public MonetDBRow getSingleRow​(int row)
      Gets a single row in this set.
      Parameters:
      row - The index of the row to retrieve starting from 1
      Returns:
      A single row in this set
    • getColumnIndexByName

      public int getColumnIndexByName​(java.lang.String columnName) throws MonetDBEmbeddedException
      Description copied from class: AbstractRowSet
      Gets a column index in the result set by name.
      Specified by:
      getColumnIndexByName in class AbstractRowSet
      Parameters:
      columnName - The column name
      Returns:
      The index number
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getSingleValueByIndex

      public <T> T getSingleValueByIndex​(int row, int column, java.lang.Class<T> javaClass)
      Gets a single value in this set as a Java class.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      row - The index of the row to retrieve
      column - The index of the column to retrieve
      javaClass - The Java class to map
      Returns:
      The value mapped to a instance of the provided class
    • getSingleValueByIndex

      public <T> T getSingleValueByIndex​(int row, int column)
      Gets a single value in this set as a Java class using the default mapping.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      row - The index of the row to retrieve
      column - The index of the column to retrieve
      Returns:
      The value mapped to a instance of the provided class
    • getSingleValueByName

      public <T> T getSingleValueByName​(int row, java.lang.String columnName, java.lang.Class<T> javaClass) throws MonetDBEmbeddedException
      Gets a single value in this set as a Java class.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      row - The index of the row to retrieve
      columnName - The name of the column to retrieve
      javaClass - The Java class to map
      Returns:
      The value mapped to a instance of the provided class
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getSingleValueByName

      public <T> T getSingleValueByName​(int row, java.lang.String columnName) throws MonetDBEmbeddedException
      Gets a single value in this set as a Java class using the default mapping.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      row - The index of the row to retrieve
      columnName - The name of the column to retrieve
      Returns:
      The value mapped to a instance of the provided class
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getColumnByIndex

      public <T> T[] getColumnByIndex​(int column, java.lang.Class<T> javaClass)
      Gets a column in this set as a Java class.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      column - The index of the column to retrieve
      javaClass - The Java class
      Returns:
      The value mapped to a instance of the provided class
    • getColumnByIndex

      public <T> T[] getColumnByIndex​(int column)
      Gets a column in this set as a Java class using the default mapping.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      column - The index of the column to retrieve
      Returns:
      The value mapped to a instance of the provided class
    • getColumnByName

      public <T> T[] getColumnByName​(java.lang.String columnName, java.lang.Class<T> javaClass) throws MonetDBEmbeddedException
      Gets a column in this set as a Java class.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      columnName - The name of the column to retrieve
      javaClass - The Java class
      Returns:
      The value mapped to a instance of the provided class
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getColumnByName

      public <T> T[] getColumnByName​(java.lang.String columnName) throws MonetDBEmbeddedException
      Gets a column in this set as a Java class using the default mapping.
      Type Parameters:
      T - A Java class mapped to a MonetDB data type
      Parameters:
      columnName - The name of the column to retrieve
      Returns:
      The value mapped to a instance of the provided class
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • iterator

      public java.util.ListIterator<MonetDBRow> iterator()
      Specified by:
      iterator in interface java.lang.Iterable