public class DataRow
extends java.lang.Object
DataTable
.Modifier | Constructor and Description |
---|---|
protected |
DataRow(DataTable table)
Initializes a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the
DataRow . |
java.lang.Object |
get(DataColumn column)
Gets the data stored in the specified
DataColumn . |
java.lang.Object |
get(int columnIndex)
Gets the data stored in the column specified by index.
|
java.lang.Object |
get(java.lang.String columnName)
Gets the data stored in the column specified by name.
|
DataRow[] |
getChildRows(DataRelation relation)
Gets the child rows of this
DataRow using the specified DataRelation . |
java.lang.Object[] |
getItemArray()
Gets all the values for this row through an array.
|
java.lang.Object[] |
getKeyValues(DataKey childKey) |
java.lang.Object |
getOriginalValue(java.lang.String columnName) |
DataRow |
getParentRow(DataRelation relation)
Gets the parent row of a
DataRow using the specified DataRelation . |
DataRow[] |
getParentRows(DataRelation relation)
Gets the parent rows of a
DataRow using the specified DataRelation . |
int |
getRowState()
Gets the current state of the row with regard to its relationship to the
DataRowCollection . |
DataTable |
getTable()
Gets the
DataTable for which this row has a schema. |
boolean |
readFrom(java.sql.ResultSet resultSet)
Reads values from the
ResultSet |
void |
remove(int index) |
void |
set(DataColumn value,
java.lang.Object column)
Sets the data stored in the specified
DataColumn . |
void |
set(int value,
java.lang.Object columnIndex)
Sets the data stored in the column specified by index.
|
void |
set(java.lang.String value,
java.lang.Object columnName)
Sets the data stored in the column specified by name.
|
void |
setItemArray(java.lang.Object[] value)
Sets all the values for this row through an array.
|
void |
setOriginalValue(java.lang.String columnName,
java.lang.Object data) |
void |
setRowState(int state) |
java.lang.String |
toString() |
protected DataRow(DataTable table)
public boolean readFrom(java.sql.ResultSet resultSet) throws java.sql.SQLException
ResultSet
resultSet
- storage to read fromjava.sql.SQLException
- if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result setpublic java.lang.Object get(int columnIndex)
columnIndex
- The zero-based index of the column.Object
that contains the data.public java.lang.Object get(java.lang.String columnName)
columnName
- The name of the column.Object
that contains the data.public java.lang.Object get(DataColumn column)
DataColumn
.column
- A DataColumn
that contains the data.Object
that contains the data.public DataTable getTable()
DataTable
for which this row has a schema.DataTable
to which this row belongs.public DataRow[] getChildRows(DataRelation relation)
DataRow
using the specified DataRelation
.relation
- The DataRelation
to use.DataRow
objects or an array of length zero.public DataRow getParentRow(DataRelation relation)
DataRow
using the specified DataRelation
.relation
- The DataRelation
to use.DataRow
of the current row.public DataRow[] getParentRows(DataRelation relation)
DataRow
using the specified DataRelation
.relation
- The DataRelation
to use.DataRow
objects or an array of length zero.public void set(int value, java.lang.Object columnIndex)
value
- An Object
that contains the data.columnIndex
- The zero-based index of the column.public void set(java.lang.String value, java.lang.Object columnName)
value
- An Object
that contains the data.columnName
- The name of the column.public void set(DataColumn value, java.lang.Object column)
DataColumn
.value
- An Object
that contains the data.column
- A DataColumn
that contains the data.public int getRowState()
DataRowCollection
.DataRowState
values. The returned value is a bitwise combination of DataRowState
constants.public void setRowState(int state)
public void delete()
DataRow
.public void setOriginalValue(java.lang.String columnName, java.lang.Object data)
public java.lang.Object getOriginalValue(java.lang.String columnName)
public java.lang.Object[] getItemArray()
Object
.public void setItemArray(java.lang.Object[] value)
value
- An array of type Object
.public java.lang.Object[] getKeyValues(DataKey childKey)
public void remove(int index)
public java.lang.String toString()
toString
in class java.lang.Object