edu.sdsc.inca.depot.persistent
Class ReportDAO
java.lang.Object
edu.sdsc.inca.depot.persistent.DAO
edu.sdsc.inca.depot.persistent.ReportDAO
public class ReportDAO
- extends DAO
This class transfers Report objects between memory and the DB.
Fields inherited from class edu.sdsc.inca.depot.persistent.DAO |
logger |
Method Summary |
static Report |
load(java.lang.Long id)
Returns a Report object from the DB with the id specified, null if
no such object appears in the DB. |
static Report |
load(Report r)
Returns a Report object from the DB with the same field values as one
specified, null if no such object appears in the DB. |
static Report |
loadOrSave(Report r)
Returns a Report object from the DB with the same field values as one
specified, or the saved version of the specified object if no such object
appears in the DB. |
static Report |
update(Report r)
A wrapper around DAO.update that handles the necessary casting. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReportDAO
public ReportDAO()
load
public static Report load(Report r)
throws PersistenceException
- Returns a Report object from the DB with the same field values as one
specified, null if no such object appears in the DB.
- Parameters:
r
- an object that contains field values used in the retrieval
- Returns:
- an object from the DB that contains the same values
- Throws:
PersistenceException
- on err
load
public static Report load(java.lang.Long id)
throws PersistenceException
- Returns a Report object from the DB with the id specified, null if
no such object appears in the DB.
- Parameters:
id
- the id of the object to be retrieved
- Returns:
- an object from the DB marked with the given id
- Throws:
PersistenceException
- on err
loadOrSave
public static Report loadOrSave(Report r)
throws PersistenceException
- Returns a Report object from the DB with the same field values as one
specified, or the saved version of the specified object if no such object
appears in the DB. Synchronized to avoid race conditions that could
result in DB duplicates.
- Parameters:
r
- an object that contains field values used in the retrieval
- Returns:
- an object from the DB that contains the same values
- Throws:
PersistenceException
- on err
update
public static Report update(Report r)
throws PersistenceException
- A wrapper around DAO.update that handles the necessary casting.
- Parameters:
r
- the object to update
- Returns:
- r, for convenience
- Throws:
PersistenceException
- on error