dk.netarkivet.wayback.indexer
Interface GenericDAO<T,PK extends java.io.Serializable>

Type Parameters:
T - The persistent class.
PK - The class of the primary key used to identify the objects.
All Known Implementing Classes:
ArchiveFileDAO, GenericHibernateDAO

public interface GenericDAO<T,PK extends java.io.Serializable>

A generic class for managing storage and retrieval of persistent objects.


Method Summary
 PK create(T newInstance)
          Persist the newInstance object into database.
 void delete(T persistentObject)
          Remove an object from persistent storage in the database.
 T read(PK id)
          Retrieve an object that was previously persisted to the database using the indicated id as primary key.
 void update(T transientObject)
          Save changes made to a persistent object.
 

Method Detail

create

PK create(T newInstance)
Persist the newInstance object into database.

Parameters:
newInstance - the object to persist.
Returns:
the key assigned to the object.

read

T read(PK id)
Retrieve an object that was previously persisted to the database using the indicated id as primary key.

Parameters:
id - the key of the object to be retrieved.
Returns:
the retrieved object.

update

void update(T transientObject)
Save changes made to a persistent object.

Parameters:
transientObject - the object to be updated.

delete

void delete(T persistentObject)
Remove an object from persistent storage in the database.

Parameters:
persistentObject - the object to be deleted.