org.openmrs.api.db.hibernate
Class HibernateLocationDAO

java.lang.Object
  extended by org.openmrs.api.db.hibernate.HibernateLocationDAO
All Implemented Interfaces:
LocationDAO

public class HibernateLocationDAO
extends java.lang.Object
implements LocationDAO

Hibernate location-related database functions


Constructor Summary
HibernateLocationDAO()
           
 
Method Summary
 void deleteLocation(Location location)
          Completely remove the location from the database.
 void deleteLocationTag(LocationTag tag)
          Completely remove the location tag from the database.
 java.util.List<Location> getAllLocations(boolean includeRetired)
          Get all locations
 java.util.List<LocationTag> getAllLocationTags(boolean includeRetired)
          Get all location tags
 Location getLocation(java.lang.Integer locationId)
          Get a location by locationId
 Location getLocation(java.lang.String name)
          Get a location by name
 Location getLocationByUuid(java.lang.String uuid)
           
 java.util.List<Location> getLocations(java.lang.String search)
          Find all locations with matching names.
 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.
 Location saveLocation(Location location)
          Create or update a location.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateLocationDAO

public HibernateLocationDAO()
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Description copied from interface: LocationDAO
Set the Hibernate SessionFactory to connect to the database.

Specified by:
setSessionFactory in interface LocationDAO
See Also:
LocationDAO.setSessionFactory(org.hibernate.SessionFactory)

saveLocation

public Location saveLocation(Location location)
Description copied from interface: LocationDAO
Create or update a location.

Specified by:
saveLocation in interface LocationDAO
Parameters:
location - Location to save
Returns:
the saved Location
See Also:
LocationDAO.saveLocation(org.openmrs.Location)

getLocation

public Location getLocation(java.lang.Integer locationId)
Description copied from interface: LocationDAO
Get a location by locationId

Specified by:
getLocation in interface LocationDAO
Parameters:
locationId - Internal Integer identifier of the Location to get
Returns:
the requested Location
See Also:
LocationDAO.getLocation(java.lang.Integer)

getLocation

public Location getLocation(java.lang.String name)
Description copied from interface: LocationDAO
Get a location by name

Specified by:
getLocation in interface LocationDAO
Parameters:
name - String name of the Location to get
Returns:
the requested Location
See Also:
LocationDAO.getLocation(java.lang.String)

getAllLocations

public java.util.List<Location> getAllLocations(boolean includeRetired)
Description copied from interface: LocationDAO
Get all locations

Specified by:
getAllLocations in interface LocationDAO
Parameters:
includeRetired - boolean - include retired locations as well?
Returns:
List object of all Locations, possibly including retired locations
See Also:
LocationDAO.getAllLocations(boolean)

getLocations

public java.util.List<Location> getLocations(java.lang.String search)
Description copied from interface: LocationDAO
Find all locations with matching names.

Specified by:
getLocations in interface LocationDAO
Parameters:
search - String name to search for
Returns:
List object of matching locations
See Also:
LocationDAO.getLocations(java.lang.String)

deleteLocation

public void deleteLocation(Location location)
Description copied from interface: LocationDAO
Completely remove the location from the database.

Specified by:
deleteLocation in interface LocationDAO
Parameters:
location - Location object to delete
See Also:
LocationDAO.deleteLocation(org.openmrs.Location)

saveLocationTag

public LocationTag saveLocationTag(LocationTag tag)
Description copied from interface: LocationDAO
Create or update a location tag.

Specified by:
saveLocationTag in interface LocationDAO
Returns:
the saved LocationTag
See Also:
LocationDAO.saveLocation(org.openmrs.Location)

getLocationTag

public LocationTag getLocationTag(java.lang.Integer locationTagId)
Description copied from interface: LocationDAO
Get a location tag by locationTagId

Specified by:
getLocationTag in interface LocationDAO
Parameters:
locationTagId - Internal Integer identifier of the tag to get
Returns:
the requested LocationTag
See Also:
LocationDAO.getLocationTag(java.lang.Integer)

getLocationTagByName

public LocationTag getLocationTagByName(java.lang.String tag)
Description copied from interface: LocationDAO
Get a location tag by name

Specified by:
getLocationTagByName in interface LocationDAO
Parameters:
tag - String representation of the LocationTag to get
Returns:
the requested LocationTag
See Also:
LocationDAO.getLocationTagByName(java.lang.String)

getAllLocationTags

public java.util.List<LocationTag> getAllLocationTags(boolean includeRetired)
Description copied from interface: LocationDAO
Get all location tags

Specified by:
getAllLocationTags in interface LocationDAO
Parameters:
includeRetired - boolean - include retired tags as well?
Returns:
List object with all LocationTags, possibly included retired ones
See Also:
LocationDAO.getAllLocationTags(boolean)

getLocationTags

public java.util.List<LocationTag> getLocationTags(java.lang.String search)
Description copied from interface: LocationDAO
Find all location tags with matching names.

Specified by:
getLocationTags in interface LocationDAO
Parameters:
search - name to search
Returns:
List with all matching LocationTags
See Also:
LocationDAO.getLocations(java.lang.String)

deleteLocationTag

public void deleteLocationTag(LocationTag tag)
Description copied from interface: LocationDAO
Completely remove the location tag from the database.

Specified by:
deleteLocationTag in interface LocationDAO
Parameters:
tag - The LocationTag to delete
See Also:
LocationDAO.deleteLocationTag(org.openmrs.LocationTag)

getLocationByUuid

public Location getLocationByUuid(java.lang.String uuid)
Specified by:
getLocationByUuid in interface LocationDAO
Parameters:
uuid - the uuid to look for
Returns:
location matching uuid
See Also:
LocationDAO.getLocationByUuid(java.lang.String)

getLocationTagByUuid

public LocationTag getLocationTagByUuid(java.lang.String uuid)
Specified by:
getLocationTagByUuid in interface LocationDAO
Returns:
See Also:
LocationDAO.getLocationTagByUuid(java.lang.String)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change