Package nl.cwi.monetdb.embedded.mapping
Class MonetDBRow
java.lang.Object
nl.cwi.monetdb.embedded.mapping.MonetDBRow
- All Implemented Interfaces:
Iterable
public final class MonetDBRow extends Object implements Iterable
A single MonetDB row in a result set.
- Author:
- Pedro Ferreira
-
Method Summary
Modifier and Type Method Description Object[]getAllColumns()Gets the columns values as Java objects.<T> TgetColumnByIndex(int index)Gets a column value as a Java class using the default mapping.<T> TgetColumnByIndex(int index, Class<T> javaClass)Gets a column value as a Java class.<T> TgetColumnByName(String columnName)Gets a column value as a Java class using the default mapping.<T> TgetColumnByName(String columnName, Class<T> javaClass)Gets a column value as a Java class.intgetNumberOfColumns()Gets the number of columns.AbstractRowSetgetRowSet()Gets the original row result set from this row.ListIterator<Object>iterator()voidsetAllColumns(Object[] values)Sets all columns values as Java objects.<T> voidsetColumnByIndex(int index, Class<T> javaClass, T value)Sets a column value as a Java class.<T> voidsetColumnByIndex(int index, T value)Sets a column value as a Java class.<T> voidsetColumnByName(String columnName, Class<T> javaClass, T value)Sets a column value as a Java class.<T> voidsetColumnByName(String columnName, T value)Sets a column value as a Java class.
-
Method Details
-
getRowSet
Gets the original row result set from this row.- Returns:
- The original row result set from this row
-
getAllColumns
Gets the columns values as Java objects.- Returns:
- The columns values as Java objects
-
setAllColumns
Sets all columns values as Java objects. Warning - this method does not override the contents in the database!- Parameters:
values- An object array of the elements to update
-
getNumberOfColumns
public int getNumberOfColumns()Gets the number of columns.- Returns:
- The number of columns
-
getColumnByIndex
Gets a column value as a Java class.- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
index- The index of the columnjavaClass- The Java class- Returns:
- The column value as a Java class
-
getColumnByIndex
public <T> T getColumnByIndex(int index)Gets a column value as a Java class using the default mapping.- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
index- The index of the column- Returns:
- The column value as a Java class
-
getColumnByName
public <T> T getColumnByName(String columnName, Class<T> javaClass) throws MonetDBEmbeddedExceptionGets a column value as a Java class.- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
columnName- The name of the columnjavaClass- The Java class- Returns:
- The column value as a Java class
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnByName
Gets a column value 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- Returns:
- The column value as a Java class
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
setColumnByIndex
public <T> void setColumnByIndex(int index, T value)Sets a column value as a Java class. Warning - this method does not override the contents in the database!- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
index- The index of the columnvalue- The value to set
-
setColumnByIndex
Sets a column value as a Java class. Warning - this method does not override the contents in the database!- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
index- The index of the columnjavaClass- The Java classvalue- The value to set
-
setColumnByName
Sets a column value as a Java class. Warning - this method does not override the contents in the database!- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
columnName- The name of the columnvalue- The value to set- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
setColumnByName
public <T> void setColumnByName(String columnName, Class<T> javaClass, T value) throws MonetDBEmbeddedExceptionSets a column value as a Java class. Warning - this method does not override the contents in the database!- Type Parameters:
T- A Java class mapped to a MonetDB data type- Parameters:
columnName- The name of the columnjavaClass- The Java classvalue- The value to set- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
iterator
-