org.appfuse.dao
Interface Dao

All Known Subinterfaces:
LookupDao, RoleDao, UserDao
All Known Implementing Classes:
BaseDaoHibernate, LookupDaoHibernate, RoleDaoHibernate, UserDaoHibernate

public interface Dao

Data Access Object (Dao) interface. This is an interface used to tag our Dao classes and to provide common methods to all Daos.

View Source

Author:
Matt Raible

Method Summary
 Object getObject(Class clazz, Serializable id)
          Generic method to get an object based on class and identifier.
 List getObjects(Class clazz)
          Generic method used to get all objects of a particular type.
 void removeObject(Class clazz, Serializable id)
          Generic method to delete an object based on class and id
 void saveObject(Object o)
          Generic method to save an object - handles both update and insert.
 

Method Detail

getObjects

List getObjects(Class clazz)
Generic method used to get all objects of a particular type. This is the same as lookup up all rows in a table.

Parameters:
clazz - the type of objects (a.k.a. while table) to get data from
Returns:
List of populated objects

getObject

Object getObject(Class clazz,
                 Serializable id)
Generic method to get an object based on class and identifier. An ObjectRetrievalFailureException Runtime Exception is thrown if nothing is found.

Parameters:
clazz - model class to lookup
id - the identifier (primary key) of the class
Returns:
a populated object
See Also:
ObjectRetrievalFailureException

saveObject

void saveObject(Object o)
Generic method to save an object - handles both update and insert.

Parameters:
o - the object to save

removeObject

void removeObject(Class clazz,
                  Serializable id)
Generic method to delete an object based on class and id

Parameters:
clazz - model class to lookup
id - the identifier (primary key) of the class


Copyright � 2002-2006