public interface DBElement
Modifier and Type | Method and Description |
---|---|
java.util.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(java.sql.Connection aConn,
java.util.HashMap ahmKeys)
This method should be called to fill the DBElement with current data
as present in the database.
|
int |
remove(java.sql.Connection aConn)
This method provides a convenient short-cut to delete the DBElement from
the persistent store.
|
int |
save(java.sql.Connection aConn)
This method can be called when changes need to be persisted.
|
void load(java.sql.Connection aConn, java.util.HashMap ahmKeys) throws java.sql.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.java.sql.SQLException
- When the retrieve fails (e.g.: PK does not exist).int save(java.sql.Connection aConn) throws java.sql.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.java.sql.SQLException
- When the save fails (e.g.: Connection gone stale).int remove(java.sql.Connection aConn) throws java.sql.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.java.sql.SQLException
- When the save fails (e.g.: PK not found).java.util.HashMap getAllProperties()
boolean isChanged()
boolean isToBeDeleted()
boolean isDeleted()
Copyright © 2013. All Rights Reserved.