|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DBElement
This interface indicates that the implementing class can be stored, manipulated and deleted in a permanent storage (typically a RDBMS).
Method Summary | |
---|---|
HashMap |
getAllProperties()
This method will return a HashMap with all the properties for this DBElement. |
boolean |
isChanged()
This method signals whether the DBElement has changes that should be persisted. |
boolean |
isDeleted()
This method signals whether the DBElement has been deleted in the persistent store. |
boolean |
isToBeDeleted()
This method signals whether the DBElement is marked for deletion. |
void |
load(Connection aConn,
HashMap ahmKeys)
This method should be called to fill the DBElement with current data as present in the database. |
int |
remove(Connection aConn)
This method provides a convenient short-cut to delete the DBElement from the persistent store. |
int |
save(Connection aConn)
This method can be called when changes need to be persisted. |
Method Detail |
---|
void load(Connection aConn, HashMap ahmKeys) throws SQLException
aConn
- The Connection on which to execute SQL statements.
It should be an open connection and the implementation
should refrain from closing it, so the caller can reuse it.ahmKeys
- HashMap with the 'key-value' pairs necessary for the
construction of the primary key for the DBElement to be retrieved.
SQLException
- When the retrieve fails (e.g.: PK does not exist).int save(Connection aConn) throws SQLException
aConn
- The Connection on which to execute SQL statements.
It should be an open connection and the implementation
should refrain from closing it, so the caller can reuse it.
SQLException
- When the save fails (e.g.: Connection gone stale).int remove(Connection aConn) throws SQLException
aConn
- The Connection on which to execute SQL statements.
It should be an open connection and the implementation
should refrain from closing it, so the caller can reuse it.
SQLException
- When the save fails (e.g.: PK not found).HashMap getAllProperties()
boolean isChanged()
boolean isToBeDeleted()
boolean isDeleted()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |