public class HibernatePersonDAO extends java.lang.Object implements PersonDAO
PersonService ps = Context.getPersonService();
ps.getPeople("name", false);
PersonDAO
,
PersonService
,
Context
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
HibernatePersonDAO() |
Modifier and Type | Method and Description |
---|---|
void |
deletePerson(Person person) |
static void |
deletePersonAndAttributes(org.hibernate.SessionFactory sessionFactory,
Person person)
Used by deletePerson, deletePatient, and deleteUser to remove all properties of a person
before deleting them.
|
void |
deletePersonAttributeType(PersonAttributeType type) |
void |
deleteRelationship(Relationship relationship) |
void |
deleteRelationshipType(RelationshipType relationshipType) |
java.util.List<PersonAttributeType> |
getAllPersonAttributeTypes(boolean includeRetired) |
java.util.List<PersonMergeLog> |
getAllPersonMergeLogs()
Gets all the PersonMergeLog objects in the model
|
java.util.List<Relationship> |
getAllRelationships(boolean includeVoided) |
java.util.List<RelationshipType> |
getAllRelationshipTypes(boolean includeRetired) |
PersonMergeLog |
getLosingPersonMergeLogs(Person person)
Finds the PersonMergeLog by loser
|
protected static java.lang.Integer |
getMaximumSearchResults()
Fetch the max results value from the global properties table
|
java.util.List<Person> |
getPeople(java.lang.String name,
java.lang.Boolean dead) |
Person |
getPerson(java.lang.Integer personId) |
PersonAddress |
getPersonAddressByUuid(java.lang.String uuid) |
PersonAttribute |
getPersonAttribute(java.lang.Integer id) |
PersonAttribute |
getPersonAttributeByUuid(java.lang.String uuid) |
PersonAttributeType |
getPersonAttributeType(java.lang.Integer typeId) |
PersonAttributeType |
getPersonAttributeTypeByUuid(java.lang.String uuid)
Auto generated method comment
|
java.util.List<PersonAttributeType> |
getPersonAttributeTypes(java.lang.String exactName,
java.lang.String format,
java.lang.Integer foreignKey,
java.lang.Boolean searchable) |
Person |
getPersonByUuid(java.lang.String uuid)
Auto generated method comment
|
PersonMergeLog |
getPersonMergeLog(java.lang.Integer id)
Gets a
PersonMergeLog object from the model by id |
PersonMergeLog |
getPersonMergeLogByUuid(java.lang.String uuid)
Gets a PersonMergeLog object from the model using UUID
|
PersonName |
getPersonName(java.lang.Integer personNameId) |
PersonName |
getPersonNameByUuid(java.lang.String uuid) |
Relationship |
getRelationship(java.lang.Integer relationshipId) |
Relationship |
getRelationshipByUuid(java.lang.String uuid)
Auto generated method comment
|
java.util.List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType) |
java.util.List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType,
java.util.Date startEffectiveDate,
java.util.Date endEffectiveDate) |
RelationshipType |
getRelationshipType(java.lang.Integer relationshipTypeId) |
RelationshipType |
getRelationshipTypeByUuid(java.lang.String uuid)
Auto generated method comment
|
java.util.List<RelationshipType> |
getRelationshipTypes(java.lang.String relationshipTypeName,
java.lang.Boolean preferred) |
java.lang.String |
getSavedPersonAttributeTypeName(PersonAttributeType personAttributeType)
Gets the value of name currently saved in the database for the given personAttributeType,
bypassing any caches.
|
java.util.Set<Person> |
getSimilarPeople(java.lang.String name,
java.lang.Integer birthyear,
java.lang.String gender) |
java.util.List<PersonMergeLog> |
getWinningPersonMergeLogs(Person person)
Gets the PersonMergeLog objects by winner
|
Person |
savePerson(Person person) |
PersonAddress |
savePersonAddress(PersonAddress personAddress) |
PersonAttributeType |
savePersonAttributeType(PersonAttributeType type) |
PersonMergeLog |
savePersonMergeLog(PersonMergeLog personMergeLog)
Saves a
PersonMergeLog object to the database |
PersonName |
savePersonName(PersonName personName) |
Relationship |
saveRelationship(Relationship relationship) |
RelationshipType |
saveRelationshipType(RelationshipType relationshipType) |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set session factory
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- public java.util.Set<Person> getSimilarPeople(java.lang.String name, java.lang.Integer birthyear, java.lang.String gender) throws DAOException
getSimilarPeople
in interface PersonDAO
DAOException
PersonService.getSimilarPeople(java.lang.String,java.lang.Integer,java.lang.String,java.lang.String)
,
org.openmrs.api.db.PersonDAO#getSimilarPeople(java.lang.String,java.lang.Integer,java.lang.String,java.lang.String)
public java.util.List<Person> getPeople(java.lang.String name, java.lang.Boolean dead)
getPeople
in interface PersonDAO
PersonDAO.getPeople(java.lang.String, java.lang.Boolean)
protected static java.lang.Integer getMaximumSearchResults()
public Person getPerson(java.lang.Integer personId)
getPerson
in interface PersonDAO
PersonService.getPerson(java.lang.Integer)
,
PersonDAO.getPerson(java.lang.Integer)
public void deletePersonAttributeType(PersonAttributeType type)
public PersonAttributeType savePersonAttributeType(PersonAttributeType type)
public PersonAttributeType getPersonAttributeType(java.lang.Integer typeId)
getPersonAttributeType
in interface PersonDAO
PersonService.getPersonAttributeType(java.lang.Integer)
,
PersonDAO.getPersonAttributeType(java.lang.Integer)
public PersonAttribute getPersonAttribute(java.lang.Integer id)
getPersonAttribute
in interface PersonDAO
PersonService.getPersonAttribute(java.lang.Integer)
,
PersonDAO.getPersonAttribute(java.lang.Integer)
public java.util.List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws DAOException
getAllPersonAttributeTypes
in interface PersonDAO
DAOException
PersonService.getAllPersonAttributeTypes(boolean)
,
PersonDAO.getAllPersonAttributeTypes(boolean)
public java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String exactName, java.lang.String format, java.lang.Integer foreignKey, java.lang.Boolean searchable) throws DAOException
getPersonAttributeTypes
in interface PersonDAO
DAOException
PersonDAO.getPersonAttributeTypes(java.lang.String, java.lang.String,
java.lang.Integer, java.lang.Boolean)
public Relationship getRelationship(java.lang.Integer relationshipId) throws DAOException
getRelationship
in interface PersonDAO
DAOException
PersonService.getRelationship(java.lang.Integer)
,
PersonDAO.getRelationship(java.lang.Integer)
public java.util.List<Relationship> getAllRelationships(boolean includeVoided) throws DAOException
getAllRelationships
in interface PersonDAO
DAOException
PersonService.getAllRelationships(boolean)
,
PersonDAO.getAllRelationships(boolean)
public java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType)
public java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, java.util.Date startEffectiveDate, java.util.Date endEffectiveDate)
getRelationships
in interface PersonDAO
PersonService.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(java.lang.Integer relationshipTypeId) throws DAOException
getRelationshipType
in interface PersonDAO
DAOException
PersonService.getRelationshipType(java.lang.Integer)
,
PersonDAO.getRelationshipType(java.lang.Integer)
public java.util.List<RelationshipType> getRelationshipTypes(java.lang.String relationshipTypeName, java.lang.Boolean preferred) throws DAOException
getRelationshipTypes
in interface PersonDAO
DAOException
PersonService.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 PersonDAO
DAOException
PersonService.saveRelationshipType(org.openmrs.RelationshipType)
,
PersonDAO.saveRelationshipType(org.openmrs.RelationshipType)
public void deleteRelationshipType(RelationshipType relationshipType) throws DAOException
deleteRelationshipType
in interface PersonDAO
DAOException
PersonService.deleteRelationshipType(org.openmrs.RelationshipType)
,
PersonDAO.deleteRelationshipType(org.openmrs.RelationshipType)
public void deletePerson(Person person) throws DAOException
deletePerson
in interface PersonDAO
DAOException
PersonService.purgePerson(org.openmrs.Person)
,
PersonDAO.deletePerson(org.openmrs.Person)
public Person savePerson(Person person) throws DAOException
savePerson
in interface PersonDAO
DAOException
PersonService.savePerson(org.openmrs.Person)
,
PersonDAO.savePerson(org.openmrs.Person)
public Relationship saveRelationship(Relationship relationship) throws DAOException
saveRelationship
in interface PersonDAO
DAOException
PersonService.saveRelationship(org.openmrs.Relationship)
,
PersonDAO.saveRelationship(org.openmrs.Relationship)
public void deleteRelationship(Relationship relationship) throws DAOException
deleteRelationship
in interface PersonDAO
DAOException
PersonService.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(java.lang.String uuid)
PersonDAO
getPersonAttributeTypeByUuid
in interface PersonDAO
PersonDAO.getPersonAttributeTypeByUuid(java.lang.String)
public java.lang.String getSavedPersonAttributeTypeName(PersonAttributeType personAttributeType)
PersonDAO
OpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES
and reference the given
personAttributeType. getSavedPersonAttributeTypeName
in interface PersonDAO
personAttributeType
- the personAttributeType get the the name ofPersonDAO.getSavedPersonAttributeTypeName(org.openmrs.PersonAttributeType)
public Person getPersonByUuid(java.lang.String uuid)
PersonDAO
getPersonByUuid
in interface PersonDAO
PersonDAO.getPersonByUuid(java.lang.String)
public PersonAddress getPersonAddressByUuid(java.lang.String uuid)
getPersonAddressByUuid
in interface PersonDAO
public PersonMergeLog savePersonMergeLog(PersonMergeLog personMergeLog) throws DAOException
PersonDAO
PersonMergeLog
object to the databasesavePersonMergeLog
in interface PersonDAO
personMergeLog
- the PersonMergeLog
object to savePersonMergeLog
objectDAOException
PersonDAO.savePersonMergeLog(PersonMergeLog)
public PersonMergeLog getPersonMergeLog(java.lang.Integer id) throws DAOException
PersonDAO
PersonMergeLog
object from the model by idgetPersonMergeLog
in interface PersonDAO
id
- the id of the PersonMergeLog
object to retrievePersonMergeLog
objectDAOException
PersonDAO.getPersonMergeLog(java.lang.Integer)
public PersonMergeLog getPersonMergeLogByUuid(java.lang.String uuid) throws DAOException
PersonDAO
getPersonMergeLogByUuid
in interface PersonDAO
uuid
- the UUID of the PersonMergeLog object to retrieveDAOException
PersonDAO.getPersonMergeLogByUuid(String)
public java.util.List<PersonMergeLog> getWinningPersonMergeLogs(Person person) throws DAOException
PersonDAO
getWinningPersonMergeLogs
in interface PersonDAO
person
- the winning personPersonMergeLog
objectsDAOException
PersonDAO.getWinningPersonMergeLogs(org.openmrs.Person)
public PersonMergeLog getLosingPersonMergeLogs(Person person) throws DAOException
PersonDAO
getLosingPersonMergeLogs
in interface PersonDAO
PersonMergeLog
objectDAOException
PersonDAO.getLosingPersonMergeLogs(org.openmrs.Person)
public java.util.List<PersonMergeLog> getAllPersonMergeLogs() throws DAOException
PersonDAO
getAllPersonMergeLogs
in interface PersonDAO
DAOException
org.openmrs.api.db.PersonDAO#getPersonMergeLogsByWinner(Person)
public PersonAttribute getPersonAttributeByUuid(java.lang.String uuid)
getPersonAttributeByUuid
in interface PersonDAO
public PersonName getPersonName(java.lang.Integer personNameId)
getPersonName
in interface PersonDAO
PersonDAO.getPersonName(Integer)
public PersonName getPersonNameByUuid(java.lang.String uuid)
getPersonNameByUuid
in interface PersonDAO
PersonDAO.getPersonNameByUuid(String)
public Relationship getRelationshipByUuid(java.lang.String uuid)
PersonDAO
getRelationshipByUuid
in interface PersonDAO
PersonDAO.getRelationshipByUuid(java.lang.String)
public RelationshipType getRelationshipTypeByUuid(java.lang.String uuid)
PersonDAO
getRelationshipTypeByUuid
in interface PersonDAO
PersonDAO.getRelationshipTypeByUuid(java.lang.String)
public java.util.List<RelationshipType> getAllRelationshipTypes(boolean includeRetired)
getAllRelationshipTypes
in interface PersonDAO
PersonDAO.getAllRelationshipTypes(boolean)
public PersonName savePersonName(PersonName personName)
savePersonName
in interface PersonDAO
PersonService.savePersonName(org.openmrs.PersonName)
,
PersonDAO.savePersonName(org.openmrs.PersonName)
public PersonAddress savePersonAddress(PersonAddress personAddress)
savePersonAddress
in interface PersonDAO
PersonService.savePersonAddress(org.openmrs.PersonAddress)
,
PersonDAO.savePersonAddress(org.openmrs.PersonAddress)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.