com.syncsoft.plainsql
Class Row

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap<java.lang.String,java.lang.Object>
          extended by com.syncsoft.plainsql.Row
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, java.util.SortedMap<java.lang.String,java.lang.Object>

public class Row
extends java.util.TreeMap<java.lang.String,java.lang.Object>

Object to represent a single row. Essentially a HashMap If associated with a RowSet, then validation will be performed on column names, otherwise you can do what you will with it.

See Also:
Serialized Form

Constructor Summary
Row()
           
 
Method Summary
 void deleteRow()
          Delete the row from the database (if possible)
 java.lang.Integer getInt(java.lang.String column)
          Return the column value as an integer
 RowSet getRowSet()
          Returns RowSet that this row belongs to
 int getRowSetIdx()
           
 java.lang.String getString(java.lang.String column)
          Return the column value as an String
 java.lang.Object getValue(java.lang.Object column)
          Get the value of a specific column
 void setColumn(java.lang.String columnName, java.lang.Object columnValue)
          Change the value for a specific column
 void setRow(java.lang.Object... args)
          Set more than one column in a row at once.
 void setRowSet(RowSet rowSet)
          Sets the rowSet that this row belongs to
 void setRowSetIdx(int rowSetIdx)
           
 void updateRow()
          Push the rows changes into the database, if there is a RowSet that is associated with a PlainTable
 
Methods inherited from class java.util.TreeMap
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, put, putAll, remove, size, subMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Constructor Detail

Row

public Row()
Method Detail

deleteRow

public void deleteRow()
               throws java.sql.SQLException
Delete the row from the database (if possible)

Throws:
java.sql.SQLException

getInt

public java.lang.Integer getInt(java.lang.String column)
                         throws java.sql.SQLException
Return the column value as an integer

Parameters:
column - Column name
Returns:
An integer
Throws:
java.sql.SQLException

getValue

public java.lang.Object getValue(java.lang.Object column)
                          throws java.sql.SQLException
Get the value of a specific column

Parameters:
column -
Returns:
Throws:
java.sql.SQLException

getRowSet

public RowSet getRowSet()
Returns RowSet that this row belongs to

Returns:
RowSet

getRowSetIdx

public int getRowSetIdx()
Returns:
Returns the rowSetIdx.

getString

public java.lang.String getString(java.lang.String column)
                           throws java.sql.SQLException
Return the column value as an String

Parameters:
column - Column name
Returns:
A String
Throws:
java.sql.SQLException

setColumn

public void setColumn(java.lang.String columnName,
                      java.lang.Object columnValue)
               throws java.sql.SQLException
Change the value for a specific column

Parameters:
columnName - Name of the columns
columnValue - New value for the column
Throws:
java.sql.SQLException

setRow

public void setRow(java.lang.Object... args)
            throws java.sql.SQLException
Set more than one column in a row at once. Arguments are of the form column_name,column_value...

Parameters:
args - column_name,column_value...
Throws:
java.sql.SQLException

setRowSet

public void setRowSet(RowSet rowSet)
Sets the rowSet that this row belongs to

Parameters:
rowSet -

setRowSetIdx

public void setRowSetIdx(int rowSetIdx)
Parameters:
rowSetIdx - The rowSetIdx to set.

updateRow

public void updateRow()
               throws java.sql.SQLException
Push the rows changes into the database, if there is a RowSet that is associated with a PlainTable

Throws:
java.sql.SQLException