com.darwinsys.database
Interface GenericDAO<T,PK extends java.io.Serializable>


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

Interface to be implemented by DAOs; using Java 5 Generics.

Author:
Per Mellqvist, http://www.ibm.com/developerworks/java/library/j-genericdao.html

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 saved in the database under the given primary key (id).
 void update(T transientObject)
          Save changes made to a persistent object.
 

Method Detail

create

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


read

T read(PK id)
Retrieve an object that was previously saved in the database under the given primary key (id).


update

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


delete

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



Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.