public class HibernatePersonDAO extends Object implements PersonDAO
PersonService ps = Context.getPersonService();
ps.getPeople("name", false);
PersonDAO,
PersonService,
Context| Constructor and Description |
|---|
HibernatePersonDAO() |
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - public Set<Person> getSimilarPeople(String name, Integer birthyear, String gender) throws DAOException
getSimilarPeople in interface PersonDAODAOExceptionPersonService.getSimilarPeople(String name, Integer birthyear, String gender),
PersonDAO.getSimilarPeople(String name, Integer birthyear, String gender)public List<Person> getPeople(String searchString, Boolean dead, Boolean voided)
getPeople in interface PersonDAOShould get no one by null
Should get every one by empty string
Should get no one by non-existing attribute
Should get no one by non-searchable attribute
Should get no one by voided attribute
Should get one person by attribute
Should get one person by random case attribute
Should get one person by searching for a mix of attribute and voided attribute
Should get multiple people by single attribute
Should get multiple people by multiple attributes
Should get no one by non-existing name
Should get one person by name
Should get one person by random case name
Should get multiple people by single name
Should get multiple people by multiple names
Should get no one by non-existing name and non-existing attribute
Should get no one by non-existing name and non-searchable attribute
Should get no one by non-existing name and voided attribute
Should get one person by name and attribute
Should get one person by name and voided attribute
Should get multiple people by name and attribute
Should get one person by given name
Should get multiple people by given name
Should get one person by middle name
Should get multiple people by middle name
Should get one person by family name
Should get multiple people by family name
Should get one person by family name2
Should get multiple people by family name2
Should get one person by multiple name parts
Should get multiple people by multiple name parts
Should get no one by voided name
Should not get voided person
Should not get dead person
Should get single dead person
Should get multiple dead peoplepublic List<Person> getPeople(String searchString, Boolean dead)
getPeople in interface PersonDAOPersonService.getPeople(String, Boolean)public static Integer getMaximumSearchResults()
public Person getPerson(Integer personId)
getPerson in interface PersonDAOPersonService.getPerson(java.lang.Integer),
PersonDAO.getPerson(java.lang.Integer)public void deletePersonAttributeType(PersonAttributeType type)
public PersonAttributeType savePersonAttributeType(PersonAttributeType type)
public PersonAttributeType getPersonAttributeType(Integer typeId)
getPersonAttributeType in interface PersonDAOPersonService.getPersonAttributeType(java.lang.Integer),
PersonDAO.getPersonAttributeType(java.lang.Integer)public PersonAttribute getPersonAttribute(Integer id)
getPersonAttribute in interface PersonDAOPersonService.getPersonAttribute(java.lang.Integer),
PersonDAO.getPersonAttribute(java.lang.Integer)public List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws DAOException
getAllPersonAttributeTypes in interface PersonDAODAOExceptionPersonService.getAllPersonAttributeTypes(boolean),
PersonDAO.getAllPersonAttributeTypes(boolean)public List<PersonAttributeType> getPersonAttributeTypes(String exactName, String format, Integer foreignKey, Boolean searchable) throws DAOException
getPersonAttributeTypes in interface PersonDAODAOExceptionPersonDAO.getPersonAttributeTypes(java.lang.String, java.lang.String,
java.lang.Integer, java.lang.Boolean)public Relationship getRelationship(Integer relationshipId) throws DAOException
getRelationship in interface PersonDAODAOExceptionPersonService.getRelationship(java.lang.Integer),
PersonDAO.getRelationship(java.lang.Integer)public List<Relationship> getAllRelationships(boolean includeVoided) throws DAOException
getAllRelationships in interface PersonDAODAOExceptionPersonService.getAllRelationships(boolean),
PersonDAO.getAllRelationships(boolean)public List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType)
public List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, Date startEffectiveDate, Date endEffectiveDate)
getRelationships in interface PersonDAOPersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType, java.util.Date, java.util.Date),
PersonDAO.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType, java.util.Date, java.util.Date)public RelationshipType getRelationshipType(Integer relationshipTypeId) throws DAOException
getRelationshipType in interface PersonDAODAOExceptionPersonService.getRelationshipType(java.lang.Integer),
PersonDAO.getRelationshipType(java.lang.Integer)public List<RelationshipType> getRelationshipTypes(String relationshipTypeName, Boolean preferred) throws DAOException
getRelationshipTypes in interface PersonDAODAOExceptionPersonService.getRelationshipTypes(java.lang.String, java.lang.Boolean),
PersonDAO.getRelationshipTypes(java.lang.String, java.lang.Boolean)public RelationshipType saveRelationshipType(RelationshipType relationshipType) throws DAOException
saveRelationshipType in interface PersonDAODAOExceptionPersonService.saveRelationshipType(org.openmrs.RelationshipType),
PersonDAO.saveRelationshipType(org.openmrs.RelationshipType)public void deleteRelationshipType(RelationshipType relationshipType) throws DAOException
deleteRelationshipType in interface PersonDAODAOExceptionPersonService.purgeRelationshipType(org.openmrs.RelationshipType),
PersonDAO.deleteRelationshipType(org.openmrs.RelationshipType)public void deletePerson(Person person) throws DAOException
deletePerson in interface PersonDAODAOExceptionPersonService.purgePerson(org.openmrs.Person),
PersonDAO.deletePerson(org.openmrs.Person)public Person savePerson(Person person) throws DAOException
savePerson in interface PersonDAODAOExceptionPersonService.savePerson(org.openmrs.Person),
PersonDAO.savePerson(org.openmrs.Person)public Relationship saveRelationship(Relationship relationship) throws DAOException
saveRelationship in interface PersonDAODAOExceptionPersonService.saveRelationship(org.openmrs.Relationship),
PersonDAO.saveRelationship(org.openmrs.Relationship)public void deleteRelationship(Relationship relationship) throws DAOException
deleteRelationship in interface PersonDAODAOExceptionPersonService.purgeRelationship(org.openmrs.Relationship),
PersonDAO.deleteRelationship(org.openmrs.Relationship)public static void deletePersonAndAttributes(org.hibernate.SessionFactory sessionFactory,
Person person)
sessionFactory - the session factory from which to pull the current sessionperson - the person to deletepublic PersonAttributeType getPersonAttributeTypeByUuid(String uuid)
getPersonAttributeTypeByUuid in interface PersonDAOPersonDAO.getPersonAttributeTypeByUuid(java.lang.String)public String getSavedPersonAttributeTypeName(PersonAttributeType personAttributeType)
PersonDAOOpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES and reference the given
personAttributeType. getSavedPersonAttributeTypeName in interface PersonDAOpersonAttributeType - the personAttributeType get the the name ofPersonDAO.getSavedPersonAttributeTypeName(org.openmrs.PersonAttributeType)public Boolean getSavedPersonAttributeTypeSearchable(PersonAttributeType personAttributeType)
PersonDAOgetSavedPersonAttributeTypeSearchable in interface PersonDAOpublic Person getPersonByUuid(String uuid)
getPersonByUuid in interface PersonDAOPersonDAO.getPersonByUuid(java.lang.String)public PersonAddress getPersonAddressByUuid(String uuid)
getPersonAddressByUuid in interface PersonDAOpublic PersonMergeLog savePersonMergeLog(PersonMergeLog personMergeLog) throws DAOException
PersonDAOPersonMergeLog object to the databasesavePersonMergeLog in interface PersonDAOpersonMergeLog - the PersonMergeLog object to savePersonMergeLog objectDAOExceptionPersonDAO.savePersonMergeLog(PersonMergeLog)public PersonMergeLog getPersonMergeLog(Integer id) throws DAOException
PersonDAOPersonMergeLog object from the model by idgetPersonMergeLog in interface PersonDAOid - the id of the PersonMergeLog object to retrievePersonMergeLog objectDAOExceptionPersonDAO.getPersonMergeLog(java.lang.Integer)public PersonMergeLog getPersonMergeLogByUuid(String uuid) throws DAOException
PersonDAOgetPersonMergeLogByUuid in interface PersonDAOuuid - the UUID of the PersonMergeLog object to retrieveDAOExceptionPersonDAO.getPersonMergeLogByUuid(String)public List<PersonMergeLog> getWinningPersonMergeLogs(Person person) throws DAOException
PersonDAOgetWinningPersonMergeLogs in interface PersonDAOperson - the winning personPersonMergeLog objectsDAOExceptionPersonDAO.getWinningPersonMergeLogs(org.openmrs.Person)public PersonMergeLog getLosingPersonMergeLogs(Person person) throws DAOException
PersonDAOgetLosingPersonMergeLogs in interface PersonDAOPersonMergeLog objectDAOExceptionPersonDAO.getLosingPersonMergeLogs(org.openmrs.Person)public List<PersonMergeLog> getAllPersonMergeLogs() throws DAOException
PersonDAOgetAllPersonMergeLogs in interface PersonDAODAOExceptionPersonDAO.getAllPersonMergeLogs()public PersonAttribute getPersonAttributeByUuid(String uuid)
getPersonAttributeByUuid in interface PersonDAOpublic PersonName getPersonName(Integer personNameId)
getPersonName in interface PersonDAOPersonDAO.getPersonName(Integer)public PersonName getPersonNameByUuid(String uuid)
getPersonNameByUuid in interface PersonDAOPersonDAO.getPersonNameByUuid(String)public Relationship getRelationshipByUuid(String uuid)
getRelationshipByUuid in interface PersonDAOPersonDAO.getRelationshipByUuid(java.lang.String)public RelationshipType getRelationshipTypeByUuid(String uuid)
getRelationshipTypeByUuid in interface PersonDAOPersonDAO.getRelationshipTypeByUuid(java.lang.String)public List<RelationshipType> getAllRelationshipTypes(boolean includeRetired)
getAllRelationshipTypes in interface PersonDAOPersonDAO.getAllRelationshipTypes(boolean)public PersonName savePersonName(PersonName personName)
savePersonName in interface PersonDAOPersonService.savePersonName(org.openmrs.PersonName),
PersonDAO.savePersonName(org.openmrs.PersonName)public PersonAddress savePersonAddress(PersonAddress personAddress)
savePersonAddress in interface PersonDAOPersonService.savePersonAddress(org.openmrs.PersonAddress),
PersonDAO.savePersonAddress(org.openmrs.PersonAddress)Copyright © 2024 OpenMRS Inc.. All rights reserved.