|
Anyframe Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectanyframe.core.basis.dao.hibernate.GenericDaoHibernate<T,PK>
T - a type variablePK - the primary key for that typepublic class GenericDaoHibernate<T,PK extends Serializable>
This class serves as the Base class for all other DAOs - namely to hold common CRUD methods that they might all use. You should only need to extend this class when your require custom CRUD logic.
| Field Summary | |
|---|---|
protected Log |
log
Log variable for all child classes. |
| Constructor Summary | |
|---|---|
GenericDaoHibernate(Class<T> persistentClass)
Constructor that takes in a class to see which type of entity to persist. |
|
| Method Summary | |
|---|---|
boolean |
exists(PK id)
Checks for existence of an object of type T using the id arg. |
T |
get(PK id)
Generic method to get an object based on class and identifier. |
IDynamicHibernateService |
getDynamicHibernateService()
|
HibernateTemplate |
getHibernateTemplate()
|
Page |
getList(SearchVO searchVO)
Generic method to get object list based on search condition and search keyword |
Class<T> |
getPersistentClass()
|
IPropertiesService |
getPropertiesService()
|
org.hibernate.SessionFactory |
getSessionFactory()
|
void |
remove(PK id)
Generic method to delete an object based on class and id |
T |
save(T object)
Generic method to save an object - handles both update and insert. |
void |
setDynamicHibernateService(IDynamicHibernateService dynamicHibernateService)
Sets the dynamicHibernateService to use. |
void |
setPropertiesService(IPropertiesService propertiesService)
Sets the propertiesService to use. |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Log log
| Constructor Detail |
|---|
public GenericDaoHibernate(Class<T> persistentClass)
persistentClass - the class type you'd like to persist| Method Detail |
|---|
public Class<T> getPersistentClass()
public void setPropertiesService(IPropertiesService propertiesService)
propertiesService - The propertiesService to setpublic void setDynamicHibernateService(IDynamicHibernateService dynamicHibernateService)
dynamicHibernateService - The dynamicHibernateService to setpublic HibernateTemplate getHibernateTemplate()
public org.hibernate.SessionFactory getSessionFactory()
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
public T get(PK id)
throws Exception
get in interface GenericDao<T,PK extends Serializable>id - the identifier (primary key) of the
object to get
ExceptionObjectRetrievalFailureException
public boolean exists(PK id)
throws Exception
exists in interface GenericDao<T,PK extends Serializable>id - the id of the entity
Exception
public T save(T object)
throws Exception
save in interface GenericDao<T,PK extends Serializable>object - the object to save
Exception
public void remove(PK id)
throws Exception
remove in interface GenericDao<T,PK extends Serializable>id - the identifier (primary key) of the
object to remove
Exceptionpublic IPropertiesService getPropertiesService()
public IDynamicHibernateService getDynamicHibernateService()
public Page getList(SearchVO searchVO)
throws Exception
getList in interface GenericDao<T,PK extends Serializable>searchVO - search condition and search keyword
Exception
|
Anyframe Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||