public class HibernateOpenmrsObjectDAO<T extends BaseOpenmrsObject> extends Object implements OpenmrsObjectDAO<T>
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
mappedClass |
protected org.hibernate.SessionFactory |
sessionFactory |
Constructor and Description |
---|
HibernateOpenmrsObjectDAO() |
Modifier and Type | Method and Description |
---|---|
void |
delete(T persistent)
Completely deletes a persistent from the database
|
T |
getById(Serializable id)
Obtains an object matching a given identifier
|
T |
getByUuid(String uuid)
Obtains an object matching a given UUID
|
T |
saveOrUpdate(T persistent)
Save or update a persistent in the database
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory) |
@Autowired protected org.hibernate.SessionFactory sessionFactory
protected Class<T extends BaseOpenmrsObject> mappedClass
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
public T getById(Serializable id)
OpenmrsObjectDAO
getById
in interface OpenmrsObjectDAO<T extends BaseOpenmrsObject>
id
- the metadata identifierpublic T getByUuid(String uuid)
OpenmrsObjectDAO
getByUuid
in interface OpenmrsObjectDAO<T extends BaseOpenmrsObject>
OpenmrsObjectDAO.getByUuid(java.lang.String)
public void delete(T persistent)
OpenmrsObjectDAO
delete
in interface OpenmrsObjectDAO<T extends BaseOpenmrsObject>
persistent
- The persistent to deleteOpenmrsObjectDAO.delete(org.openmrs.BaseOpenmrsObject)
public T saveOrUpdate(T persistent)
OpenmrsObjectDAO
saveOrUpdate
in interface OpenmrsObjectDAO<T extends BaseOpenmrsObject>
persistent
- The persistent to save or updateOpenmrsObjectDAO.saveOrUpdate(org.openmrs.BaseOpenmrsObject)
Copyright © 2024 OpenMRS Inc.. All rights reserved.