public class HibernateLocationDAO extends Object implements LocationDAO
| Constructor and Description |
|---|
HibernateLocationDAO() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteLocation(Location location)
Completely remove the location from the database.
|
void |
deleteLocationAttributeType(LocationAttributeType locationAttributeType) |
void |
deleteLocationTag(LocationTag tag)
Completely remove the location tag from the database.
|
List<LocationAttributeType> |
getAllLocationAttributeTypes() |
List<Location> |
getAllLocations(boolean includeRetired)
Get all locations
|
List<LocationTag> |
getAllLocationTags(boolean includeRetired)
Get all location tags
|
Long |
getCountOfLocations(String nameFragment,
Boolean includeRetired) |
Location |
getLocation(Integer locationId)
Get a location by locationId
|
Location |
getLocation(String name)
Get a location by name
|
LocationAttribute |
getLocationAttributeByUuid(String uuid) |
LocationAttributeType |
getLocationAttributeType(Integer id) |
LocationAttributeType |
getLocationAttributeTypeByName(String name) |
LocationAttributeType |
getLocationAttributeTypeByUuid(String uuid) |
Location |
getLocationByUuid(String uuid) |
List<Location> |
getLocations(String nameFragment,
Location parent,
Map<LocationAttributeType,String> serializedAttributeValues,
boolean includeRetired,
Integer start,
Integer length)
Gets the locations matching the specified arguments
|
List<Location> |
getLocationsHavingAllTags(List<LocationTag> tags)
Get locations that have all the location tags specified.
|
LocationTag |
getLocationTag(Integer locationTagId)
Get a location tag by
locationTagId |
LocationTag |
getLocationTagByName(String tag)
Get a location tag by name
|
LocationTag |
getLocationTagByUuid(String uuid) |
List<LocationTag> |
getLocationTags(String search)
Find all location tags with matching names.
|
List<Location> |
getRootLocations(boolean includeRetired) |
Location |
saveLocation(Location location)
Create or update a location.
|
LocationAttributeType |
saveLocationAttributeType(LocationAttributeType locationAttributeType) |
LocationTag |
saveLocationTag(LocationTag tag)
Create or update a location tag.
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set the Hibernate SessionFactory to connect to the database.
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
LocationDAOsetSessionFactory in interface LocationDAOLocationDAO.setSessionFactory(org.hibernate.SessionFactory)public Location saveLocation(Location location)
LocationDAOsaveLocation in interface LocationDAOlocation - Location to saveLocationLocationDAO.saveLocation(org.openmrs.Location)public Location getLocation(Integer locationId)
LocationDAOgetLocation in interface LocationDAOlocationId - Internal Integer identifier of the Location to getLocationLocationDAO.getLocation(java.lang.Integer)public Location getLocation(String name)
LocationDAOgetLocation in interface LocationDAOname - String name of the Location to getLocationLocationDAO.getLocation(java.lang.String)public List<Location> getAllLocations(boolean includeRetired)
LocationDAOgetAllLocations in interface LocationDAOincludeRetired - boolean - include retired locations as well?List<Location> object of all Locations, possibly including
retired locationsLocationDAO.getAllLocations(boolean)public void deleteLocation(Location location)
LocationDAOdeleteLocation in interface LocationDAOlocation - Location object to deleteLocationDAO.deleteLocation(org.openmrs.Location)public LocationTag saveLocationTag(LocationTag tag)
LocationDAOsaveLocationTag in interface LocationDAOLocationTagLocationDAO.saveLocation(org.openmrs.Location)public LocationTag getLocationTag(Integer locationTagId)
LocationDAOlocationTagIdgetLocationTag in interface LocationDAOlocationTagId - Internal Integer identifier of the tag to getLocationTagLocationDAO.getLocationTag(java.lang.Integer)public LocationTag getLocationTagByName(String tag)
LocationDAOgetLocationTagByName in interface LocationDAOtag - String representation of the LocationTag to getLocationTagLocationDAO.getLocationTagByName(java.lang.String)public List<LocationTag> getAllLocationTags(boolean includeRetired)
LocationDAOgetAllLocationTags in interface LocationDAOincludeRetired - boolean - include retired tags as well?LocationTags, possibly included
retired onesLocationDAO.getAllLocationTags(boolean)public List<LocationTag> getLocationTags(String search)
LocationDAOgetLocationTags in interface LocationDAOsearch - name to searchLocationTagsLocationDAO.getLocationTags(String)public void deleteLocationTag(LocationTag tag)
LocationDAOdeleteLocationTag in interface LocationDAOtag - The LocationTag to deleteLocationDAO.deleteLocationTag(org.openmrs.LocationTag)public Location getLocationByUuid(String uuid)
getLocationByUuid in interface LocationDAOuuid - the uuid to look forLocationDAO.getLocationByUuid(java.lang.String)public LocationTag getLocationTagByUuid(String uuid)
getLocationTagByUuid in interface LocationDAOLocationDAO.getLocationTagByUuid(java.lang.String)public Long getCountOfLocations(String nameFragment, Boolean includeRetired)
getCountOfLocations in interface LocationDAOLocationDAO.getCountOfLocations(String, Boolean)public List<Location> getLocations(String nameFragment, Location parent, Map<LocationAttributeType,String> serializedAttributeValues, boolean includeRetired, Integer start, Integer length)
LocationDAOgetLocations in interface LocationDAOnameFragment - is the string used to search for locationsparent - only return children of this parentserializedAttributeValues - the serialized attribute valuesincludeRetired - specifies if retired locations should also be returnedstart - the beginning indexlength - the number of matching locations to returnLocationDAO.getLocations(String, org.openmrs.Location, java.util.Map, boolean, Integer, Integer)public List<Location> getRootLocations(boolean includeRetired) throws DAOException
getRootLocations in interface LocationDAODAOExceptionLocationDAO.getRootLocations(boolean)public List<LocationAttributeType> getAllLocationAttributeTypes()
getAllLocationAttributeTypes in interface LocationDAOLocationDAO.getAllLocationAttributeTypes()public LocationAttributeType getLocationAttributeType(Integer id)
getLocationAttributeType in interface LocationDAOLocationDAO.getLocationAttributeType(java.lang.Integer)public LocationAttributeType getLocationAttributeTypeByUuid(String uuid)
getLocationAttributeTypeByUuid in interface LocationDAOLocationDAO.getLocationAttributeTypeByUuid(java.lang.String)public LocationAttributeType saveLocationAttributeType(LocationAttributeType locationAttributeType)
saveLocationAttributeType in interface LocationDAOLocationDAO.saveLocationAttributeType(org.openmrs.LocationAttributeType)public void deleteLocationAttributeType(LocationAttributeType locationAttributeType)
deleteLocationAttributeType in interface LocationDAOLocationDAO.deleteLocationAttributeType(org.openmrs.LocationAttributeType)public LocationAttribute getLocationAttributeByUuid(String uuid)
getLocationAttributeByUuid in interface LocationDAOLocationDAO.getLocationAttributeByUuid(java.lang.String)public LocationAttributeType getLocationAttributeTypeByName(String name)
getLocationAttributeTypeByName in interface LocationDAOLocationDAO.getLocationAttributeTypeByName(java.lang.String)public List<Location> getLocationsHavingAllTags(List<LocationTag> tags)
LocationDAOgetLocationsHavingAllTags in interface LocationDAOLocationDAO.getLocationsHavingAllTags(java.util.List)Copyright © 2024 OpenMRS Inc.. All rights reserved.