org.appfuse.service.impl
Class BaseManager

java.lang.Object
  extended by org.appfuse.service.impl.BaseManager
All Implemented Interfaces:
Manager
Direct Known Subclasses:
LookupManagerImpl, RoleManagerImpl, UserManagerImpl

public class BaseManager
extends Object
implements Manager

Base class for Business Services - use this class for utility methods and generic CRUD methods.

View Source

Author:
Matt Raible

Field Summary
protected  Dao dao
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
BaseManager()
           
 
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 a 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.
 void setDao(Dao dao)
          Expose the setDao method for testing purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log

dao

protected Dao dao
Constructor Detail

BaseManager

public BaseManager()
Method Detail

setDao

public void setDao(Dao dao)
Description copied from interface: Manager
Expose the setDao method for testing purposes

Specified by:
setDao in interface Manager
See Also:
Manager.setDao(org.appfuse.dao.Dao)

getObject

public Object getObject(Class clazz,
                        Serializable id)
Description copied from interface: Manager
Generic method to get an object based on class and identifier.

Specified by:
getObject in interface Manager
Parameters:
clazz - model class to lookup
id - the identifier (primary key) of the class
Returns:
a populated object
See Also:
Manager.getObject(java.lang.Class, java.io.Serializable)

getObjects

public List getObjects(Class clazz)
Description copied from interface: Manager
Generic method used to get a all objects of a particular type.

Specified by:
getObjects in interface Manager
Parameters:
clazz - the type of objects
Returns:
List of populated objects
See Also:
Manager.getObjects(java.lang.Class)

removeObject

public void removeObject(Class clazz,
                         Serializable id)
Description copied from interface: Manager
Generic method to delete an object based on class and id

Specified by:
removeObject in interface Manager
Parameters:
clazz - model class to lookup
id - the identifier of the class
See Also:
Manager.removeObject(java.lang.Class, java.io.Serializable)

saveObject

public void saveObject(Object o)
Description copied from interface: Manager
Generic method to save an object.

Specified by:
saveObject in interface Manager
Parameters:
o - the object to save
See Also:
Manager.saveObject(java.lang.Object)


Copyright � 2002-2006