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
-
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
-
Method Details
-
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
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
Description copied from class:AbstractRowSet
Gets a column index in the result set by name.- Specified by:
getColumnIndexByName
in classAbstractRowSet
- 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 retrievecolumn
- The index of the column to retrievejavaClass
- 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 retrievecolumn
- 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 MonetDBEmbeddedExceptionGets 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 retrievecolumnName
- The name of the column to retrievejavaClass
- 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 MonetDBEmbeddedExceptionGets 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 retrievecolumnName
- 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 retrievejavaClass
- 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 MonetDBEmbeddedExceptionGets 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 retrievejavaClass
- The Java class- Returns:
- The value mapped to a instance of the provided class
- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getColumnByName
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
- Specified by:
iterator
in interfacejava.lang.Iterable
-