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 Details

    • getRowSet

      public AbstractRowSet getRowSet()
      Gets the original row result set from this row.
      Returns:
      The original row result set from this row
    • getAllColumns

      public Object[] getAllColumns()
      Gets the columns values as Java objects.
      Returns:
      The columns values as Java objects
    • setAllColumns

      public void setAllColumns​(Object[] values)
      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

      public <T> T getColumnByIndex​(int index, Class<T> javaClass)
      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 column
      javaClass - 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 MonetDBEmbeddedException
      Gets 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 column
      javaClass - The Java class
      Returns:
      The column value as a Java class
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getColumnByName

      public <T> T getColumnByName​(String columnName) throws MonetDBEmbeddedException
      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 column
      value - The value to set
    • setColumnByIndex

      public <T> void setColumnByIndex​(int index, Class<T> javaClass, 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 column
      javaClass - The Java class
      value - The value to set
    • setColumnByName

      public <T> void setColumnByName​(String columnName, T value) throws MonetDBEmbeddedException
      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 column
      value - 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 MonetDBEmbeddedException
      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 column
      javaClass - The Java class
      value - The value to set
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • iterator

      public ListIterator<Object> iterator()
      Specified by:
      iterator in interface Iterable