public class UniversalManagerImpl extends Object implements UniversalManager
Modifier and Type | Field and Description |
---|---|
protected UniversalDao |
dao
UniversalDao instance, ready to charge forward and persist to the
database
|
protected org.apache.commons.logging.Log |
log
Log instance for all child classes.
|
Constructor and Description |
---|
UniversalManagerImpl() |
Modifier and Type | Method and Description |
---|---|
Object |
get(Class<?> clazz,
Serializable id)
Generic method to get an object based on class and identifier.
|
List<?> |
getAll(Class<?> clazz)
Generic method used to get a all objects of a particular type.
|
void |
remove(Class<?> clazz,
Serializable id)
Generic method to delete an object based on class and id
|
Object |
save(Object o)
Generic method to save an object.
|
void |
setDao(UniversalDao dao) |
protected final org.apache.commons.logging.Log log
protected UniversalDao dao
public void setDao(UniversalDao dao)
public Object get(Class<?> clazz, Serializable id)
get
in interface UniversalManager
clazz
- model class to lookupid
- the identifier (primary key) of the classObjectRetrievalFailureException
public List<?> getAll(Class<?> clazz)
getAll
in interface UniversalManager
clazz
- the type of objectspublic void remove(Class<?> clazz, Serializable id)
remove
in interface UniversalManager
clazz
- model class to lookupid
- the identifier of the classpublic Object save(Object o)
save
in interface UniversalManager
o
- the object to saveCopyright © 2015. All rights reserved.