public abstract class DatabaseRow extends Object implements Cloneable
| Constructor and Description |
|---|
DatabaseRow(DatabaseTable<? extends DatabaseRow> inTable) |
DatabaseRow(DatabaseTable<? extends DatabaseRow> inTable,
ResultSet inResultSet) |
DatabaseRow(XMLTag inXMLTag) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addField(DatabaseField inField) |
protected DatabaseField |
allocateField(DatabaseCol inCol) |
protected DatabaseField |
allocateField(DatabaseCol inCol,
Object inValue) |
protected DatabaseField |
allocateField(DatabaseCol inCol,
ResultSet inResultSet) |
void |
bless()
Sets the dirty flag on all fields to false.
|
DatabaseRow |
clone() |
boolean |
delete(Connection inConn) |
abstract DatabaseTable<? extends DatabaseRow> |
getDatabaseTable() |
DatabaseField |
getField(DatabaseCol inCol) |
Collection<DatabaseField> |
getFields() |
DatabaseCol |
getIdCol() |
boolean |
insert(Connection inConn) |
static DatabaseRow |
instantiate(XMLTag inXMLTag) |
boolean |
isDirty() |
boolean |
isDirty(DatabaseCol inColumn)
Indicates whether the specified field is dirty or not.
|
protected void |
postDelete(Connection inConn) |
protected void |
postInsert(Connection inConn) |
protected void |
postUpdate(Connection inConn) |
protected void |
preDelete(Connection inConn) |
protected void |
preInsert(Connection inConn) |
protected void |
preUpdate(Connection inConn) |
boolean |
save(Connection inConn)
Invokes insert() or update() depending on whether there is an id column and
if it already has a value.
|
XMLTag |
toXMLTag() |
boolean |
update(Connection inConn) |
public DatabaseRow(DatabaseTable<? extends DatabaseRow> inTable)
public DatabaseRow(DatabaseTable<? extends DatabaseRow> inTable, ResultSet inResultSet)
public DatabaseRow(XMLTag inXMLTag)
public static DatabaseRow instantiate(XMLTag inXMLTag)
public DatabaseRow clone()
public DatabaseField getField(DatabaseCol inCol)
public Collection<DatabaseField> getFields()
public abstract DatabaseTable<? extends DatabaseRow> getDatabaseTable()
public boolean save(Connection inConn) throws SQLException
inConn - the connection to useSQLException - exception thrown if the insert/update failspublic boolean insert(Connection inConn) throws SQLException
SQLExceptionpublic boolean update(Connection inConn) throws SQLException
SQLExceptionpublic boolean delete(Connection inConn) throws SQLException
SQLExceptionpublic DatabaseCol getIdCol()
public boolean isDirty()
public boolean isDirty(DatabaseCol inColumn)
inColumn - the DatabaseCol corresponding to the fieldpublic void bless()
protected DatabaseField allocateField(DatabaseCol inCol)
protected DatabaseField allocateField(DatabaseCol inCol, Object inValue)
protected DatabaseField allocateField(DatabaseCol inCol, ResultSet inResultSet)
protected void addField(DatabaseField inField)
protected void preInsert(Connection inConn) throws SQLException
SQLExceptionprotected void postInsert(Connection inConn) throws SQLException
SQLExceptionprotected void preUpdate(Connection inConn) throws SQLException
SQLExceptionprotected void postUpdate(Connection inConn) throws SQLException
SQLExceptionprotected void preDelete(Connection inConn) throws SQLException
SQLExceptionprotected void postDelete(Connection inConn) throws SQLException
SQLException
jataylor@hairyfatguy.com