org.appfuse.dao.hibernate
Class BaseDaoHibernate
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
org.appfuse.dao.hibernate.BaseDaoHibernate
- All Implemented Interfaces:
- Dao, InitializingBean
- Direct Known Subclasses:
- LookupDaoHibernate, RoleDaoHibernate, UserDaoHibernate
public class BaseDaoHibernate
- extends HibernateDaoSupport
- implements Dao
This class serves as the Base class for all other Daos - namely to hold
common methods that they might all use. Can be used for standard CRUD
operations.
View Source
- Author:
- Matt Raible
Field Summary |
protected org.apache.commons.logging.Log |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final org.apache.commons.logging.Log log
BaseDaoHibernate
public BaseDaoHibernate()
saveObject
public void saveObject(Object o)
- Description copied from interface:
Dao
- Generic method to save an object - handles both update and insert.
- Specified by:
saveObject
in interface Dao
- Parameters:
o
- the object to save- See Also:
Dao.saveObject(java.lang.Object)
getObject
public Object getObject(Class clazz,
Serializable id)
- Description copied from interface:
Dao
- Generic method to get an object based on class and identifier. An
ObjectRetrievalFailureException Runtime Exception is thrown if
nothing is found.
- Specified by:
getObject
in interface Dao
- Parameters:
clazz
- model class to lookupid
- the identifier (primary key) of the class
- Returns:
- a populated object
- See Also:
Dao.getObject(java.lang.Class, java.io.Serializable)
getObjects
public List getObjects(Class clazz)
- Description copied from interface:
Dao
- Generic method used to get all objects of a particular type. This
is the same as lookup up all rows in a table.
- Specified by:
getObjects
in interface Dao
- Parameters:
clazz
- the type of objects (a.k.a. while table) to get data from
- Returns:
- List of populated objects
- See Also:
Dao.getObjects(java.lang.Class)
removeObject
public void removeObject(Class clazz,
Serializable id)
- Description copied from interface:
Dao
- Generic method to delete an object based on class and id
- Specified by:
removeObject
in interface Dao
- Parameters:
clazz
- model class to lookupid
- the identifier (primary key) of the class- See Also:
Dao.removeObject(java.lang.Class, java.io.Serializable)
Copyright � 2002-2006