|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectir.thinkinsql.BaseRow
ir.thinkinsql.BaseRecord
public abstract class BaseRecord
Provides an IRecord adapter, and BaseRow enhancer.
| Constructor Summary | |
|---|---|
BaseRecord()
|
|
| Method Summary | |
|---|---|
void |
afterDelete(Database db)
Called to perform extra processing after record has been deleted. |
void |
afterInsert(Database db)
Called to perform extra processing after record has been inserted |
void |
afterUpdate(Database db,
IRecord oldValue)
Called to perform extra processing after record has been updated |
void |
beforeDelete(Database db)
Called to perform extra processing before record is deleted |
void |
beforeInsert(Database db)
Called to perform extra processing before record is inserted |
void |
beforeUpdate(Database db)
Called to perform extra processing before record is updated |
boolean |
bindSpecial(Database db,
java.sql.PreparedStatement ps,
int pidx,
java.lang.String columnName,
java.lang.String propertyName)
Provides a plug point for implementers to override default binding for the named column. |
boolean |
delete()
Deletes row from home database, returns whether row was actually deleted. |
boolean |
exists()
Returns whether row with embodied key exists in home database. |
java.util.List<ChangedColumn> |
getChanges()
Returns which columns have changed since instantiation or last makeClean. |
java.lang.String[] |
getKey()
Returns key to be used to find rows. |
java.lang.String[] |
getNullableNumerics()
Returns names of columns that should update the database as null rather than 0, which is most often used for optional foreign keys. |
IRecord |
getOldValue()
Returns value of record when makeClean was last called. |
java.lang.String |
getSequenceColumn()
Returns record's sequence column, or null if not applicable. |
java.lang.String |
getSequenceName()
Returns record's sequence name, or null if not applicable. |
void |
insert()
Inserts row to home database. |
boolean |
isDirty()
Indicates whether record has been modified since it was last made clean. |
void |
makeClean()
Explicitly makes record clean |
void |
makeDirty()
Explicitly makes record dirty - could be used to force an update. |
boolean |
select(java.lang.Object... keys)
Selects row with passed keys, or embodied keys if none are passed, from home database. |
boolean |
update()
Updates row, returns whether an update occurred. |
boolean |
write()
Executes exists() ? update() : insert() |
| Methods inherited from class ir.thinkinsql.BaseRow |
|---|
afterRead, getColumns, getFields, getTemporaryProperty, putTemporaryProperty, setValueSpecial, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ir.thinkinsql.IRecord |
|---|
getTable |
| Methods inherited from interface ir.thinkinsql.IRow |
|---|
afterRead, getColumns, getDatabase, getFields, getTemporaryProperty, putTemporaryProperty, setValueSpecial |
| Constructor Detail |
|---|
public BaseRecord()
| Method Detail |
|---|
public void afterDelete(Database db)
throws java.lang.Exception
IRecord
afterDelete in interface IRecordjava.lang.Exception
public void afterInsert(Database db)
throws java.lang.Exception
IRecord
afterInsert in interface IRecordjava.lang.Exception
public void afterUpdate(Database db,
IRecord oldValue)
throws java.lang.Exception
IRecord
afterUpdate in interface IRecordjava.lang.Exception
public void beforeDelete(Database db)
throws java.lang.Exception
IRecord
beforeDelete in interface IRecordjava.lang.Exception
public void beforeInsert(Database db)
throws java.lang.Exception
IRecord
beforeInsert in interface IRecordjava.lang.Exception
public void beforeUpdate(Database db)
throws java.lang.Exception
IRecord
beforeUpdate in interface IRecordjava.lang.Exception
public boolean bindSpecial(Database db,
java.sql.PreparedStatement ps,
int pidx,
java.lang.String columnName,
java.lang.String propertyName)
throws java.lang.Exception
IRecord
bindSpecial in interface IRecordjava.lang.Exception
public boolean delete()
throws java.lang.Exception
IRecord
delete in interface IRecordjava.lang.Exception
public boolean exists()
throws java.lang.Exception
IRecord
exists in interface IRecordjava.lang.Exception
public java.util.List<ChangedColumn> getChanges()
throws java.lang.Exception
IRecord
getChanges in interface IRecordjava.lang.Exception
public java.lang.String[] getKey()
throws java.lang.Exception
IRecord
getKey in interface IRecordjava.lang.Exceptionpublic java.lang.String[] getNullableNumerics()
IRecord
getNullableNumerics in interface IRecordpublic IRecord getOldValue()
IRecord
getOldValue in interface IRecordpublic java.lang.String getSequenceColumn()
IRecord
getSequenceColumn in interface IRecordpublic java.lang.String getSequenceName()
IRecord
getSequenceName in interface IRecord
public void insert()
throws java.lang.Exception
IRecord
insert in interface IRecordjava.lang.Exceptionpublic boolean isDirty()
IRecord
isDirty in interface IRecordpublic void makeClean()
IRecord
makeClean in interface IRecordpublic void makeDirty()
IRecord
makeDirty in interface IRecord
public boolean select(java.lang.Object... keys)
throws java.lang.Exception
IRecord
select in interface IRecordjava.lang.Exception
public boolean update()
throws java.lang.Exception
IRecord
update in interface IRecordjava.lang.Exception
public boolean write()
throws java.lang.Exception
IRecord
write in interface IRecordjava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||