public class HibernateLocationDAO extends java.lang.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.
|
java.util.List<LocationAttributeType> |
getAllLocationAttributeTypes() |
java.util.List<Location> |
getAllLocations(boolean includeRetired)
Get all locations
|
java.util.List<LocationTag> |
getAllLocationTags(boolean includeRetired)
Get all location tags
|
java.lang.Long |
getCountOfLocations(java.lang.String nameFragment,
java.lang.Boolean includeRetired) |
Location |
getLocation(java.lang.Integer locationId)
Get a location by locationId
|
Location |
getLocation(java.lang.String name)
Get a location by name
|
LocationAttribute |
getLocationAttributeByUuid(java.lang.String uuid) |
LocationAttributeType |
getLocationAttributeType(java.lang.Integer id) |
LocationAttributeType |
getLocationAttributeTypeByUuid(java.lang.String uuid) |
Location |
getLocationByUuid(java.lang.String uuid) |
java.util.List<Location> |
getLocations(java.lang.String nameFragment,
Location parent,
java.util.Map<LocationAttributeType,java.lang.String> serializedAttributeValues,
boolean includeRetired,
java.lang.Integer start,
java.lang.Integer length)
Gets the locations matching the specified arguments
|
java.util.List<Location> |
getLocationsHavingAllTags(java.util.List<LocationTag> tags)
Get locations that have all the location tags specified.
|
LocationTag |
getLocationTag(java.lang.Integer locationTagId)
Get a location tag by
locationTagId |
LocationTag |
getLocationTagByName(java.lang.String tag)
Get a location tag by name
|
LocationTag |
getLocationTagByUuid(java.lang.String uuid) |
java.util.List<LocationTag> |
getLocationTags(java.lang.String search)
Find all location tags with matching names.
|
java.util.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)
LocationDAO
setSessionFactory
in interface LocationDAO
LocationDAO.setSessionFactory(org.hibernate.SessionFactory)
public Location saveLocation(Location location)
LocationDAO
saveLocation
in interface LocationDAO
location
- Location
to saveLocation
LocationDAO.saveLocation(org.openmrs.Location)
public Location getLocation(java.lang.Integer locationId)
LocationDAO
getLocation
in interface LocationDAO
locationId
- Internal Integer
identifier of the Location to get
Location
LocationDAO.getLocation(java.lang.Integer)
public Location getLocation(java.lang.String name)
LocationDAO
getLocation
in interface LocationDAO
name
- String name of the Location
to getLocation
LocationDAO.getLocation(java.lang.String)
public java.util.List<Location> getAllLocations(boolean includeRetired)
LocationDAO
getAllLocations
in interface LocationDAO
includeRetired
- boolean - include retired locations as well?List
object of all Location
s, possibly including
retired locationsLocationDAO.getAllLocations(boolean)
public void deleteLocation(Location location)
LocationDAO
deleteLocation
in interface LocationDAO
location
- Location
object to deleteLocationDAO.deleteLocation(org.openmrs.Location)
public LocationTag saveLocationTag(LocationTag tag)
LocationDAO
saveLocationTag
in interface LocationDAO
LocationTag
LocationDAO.saveLocation(org.openmrs.Location)
public LocationTag getLocationTag(java.lang.Integer locationTagId)
LocationDAO
locationTagId
getLocationTag
in interface LocationDAO
locationTagId
- Internal Integer
identifier of the tag to getLocationTag
LocationDAO.getLocationTag(java.lang.Integer)
public LocationTag getLocationTagByName(java.lang.String tag)
LocationDAO
getLocationTagByName
in interface LocationDAO
tag
- String representation of the LocationTag
to getLocationTag
LocationDAO.getLocationTagByName(java.lang.String)
public java.util.List<LocationTag> getAllLocationTags(boolean includeRetired)
LocationDAO
getAllLocationTags
in interface LocationDAO
includeRetired
- boolean - include retired tags as well?LocationTag
s, possibly included
retired onesLocationDAO.getAllLocationTags(boolean)
public java.util.List<LocationTag> getLocationTags(java.lang.String search)
LocationDAO
getLocationTags
in interface LocationDAO
search
- name to searchLocationTags
org.openmrs.api.db.LocationDAO#getLocations(java.lang.String)
public void deleteLocationTag(LocationTag tag)
LocationDAO
deleteLocationTag
in interface LocationDAO
tag
- The LocationTag
to deleteLocationDAO.deleteLocationTag(org.openmrs.LocationTag)
public Location getLocationByUuid(java.lang.String uuid)
getLocationByUuid
in interface LocationDAO
uuid
- the uuid to look forLocationDAO.getLocationByUuid(java.lang.String)
public LocationTag getLocationTagByUuid(java.lang.String uuid)
getLocationTagByUuid
in interface LocationDAO
LocationDAO.getLocationTagByUuid(java.lang.String)
public java.lang.Long getCountOfLocations(java.lang.String nameFragment, java.lang.Boolean includeRetired)
getCountOfLocations
in interface LocationDAO
LocationDAO.getCountOfLocations(String, Boolean)
public java.util.List<Location> getLocations(java.lang.String nameFragment, Location parent, java.util.Map<LocationAttributeType,java.lang.String> serializedAttributeValues, boolean includeRetired, java.lang.Integer start, java.lang.Integer length)
LocationDAO
getLocations
in interface LocationDAO
nameFragment
- 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 java.util.List<Location> getRootLocations(boolean includeRetired) throws DAOException
getRootLocations
in interface LocationDAO
DAOException
LocationDAO.getRootLocations(boolean)
public java.util.List<LocationAttributeType> getAllLocationAttributeTypes()
getAllLocationAttributeTypes
in interface LocationDAO
LocationDAO.getAllLocationAttributeTypes()
public LocationAttributeType getLocationAttributeType(java.lang.Integer id)
getLocationAttributeType
in interface LocationDAO
LocationDAO.getLocationAttributeType(java.lang.Integer)
public LocationAttributeType getLocationAttributeTypeByUuid(java.lang.String uuid)
getLocationAttributeTypeByUuid
in interface LocationDAO
LocationDAO.getLocationAttributeTypeByUuid(java.lang.String)
public LocationAttributeType saveLocationAttributeType(LocationAttributeType locationAttributeType)
saveLocationAttributeType
in interface LocationDAO
LocationDAO.saveLocationAttributeType(org.openmrs.LocationAttributeType)
public void deleteLocationAttributeType(LocationAttributeType locationAttributeType)
deleteLocationAttributeType
in interface LocationDAO
LocationDAO.deleteLocationAttributeType(org.openmrs.LocationAttributeType)
public LocationAttribute getLocationAttributeByUuid(java.lang.String uuid)
getLocationAttributeByUuid
in interface LocationDAO
LocationDAO.getLocationAttributeByUuid(java.lang.String)
public java.util.List<Location> getLocationsHavingAllTags(java.util.List<LocationTag> tags)
LocationDAO
getLocationsHavingAllTags
in interface LocationDAO
LocationDAO.getLocationsHavingAllTags(java.util.List)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.