org.openmrs.api.db
Interface LocationDAO

All Known Implementing Classes:
HibernateLocationDAO

public interface LocationDAO

Location-related database functions


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.
 

Method Detail

setSessionFactory

void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set the Hibernate SessionFactory to connect to the database.

Parameters:
sessionFactory -

saveLocation

Location saveLocation(Location location)
Create or update a location.

Parameters:
location - Location to save
Returns:
the saved Location

getLocation

Location getLocation(java.lang.Integer locationId)
Get a location by locationId

Parameters:
locationId - Internal Integer identifier of the Location to get
Returns:
the requested Location

getLocation

Location getLocation(java.lang.String name)
Get a location by name

Parameters:
name - String name of the Location to get
Returns:
the requested Location

getAllLocations

java.util.List<Location> getAllLocations(boolean includeRetired)
Get all locations

Parameters:
includeRetired - boolean - include retired locations as well?
Returns:
List object of all Locations, possibly including retired locations

getLocations

java.util.List<Location> getLocations(java.lang.String search)
Find all locations with matching names.

Parameters:
search - String name to search for
Returns:
List object of matching locations

deleteLocation

void deleteLocation(Location location)
Completely remove the location from the database.

Parameters:
location - Location object to delete

saveLocationTag

LocationTag saveLocationTag(LocationTag tag)
Create or update a location tag.

Parameters:
tag -
Returns:
the saved LocationTag

getLocationTag

LocationTag getLocationTag(java.lang.Integer locationTagId)
Get a location tag by locationTagId

Parameters:
locationTagId - Internal Integer identifier of the tag to get
Returns:
the requested LocationTag

getLocationTagByName

LocationTag getLocationTagByName(java.lang.String tag)
Get a location tag by name

Parameters:
tag - String representation of the LocationTag to get
Returns:
the requested LocationTag

getAllLocationTags

java.util.List<LocationTag> getAllLocationTags(boolean includeRetired)
Get all location tags

Parameters:
includeRetired - boolean - include retired tags as well?
Returns:
List object with all LocationTags, possibly included retired ones

getLocationTags

java.util.List<LocationTag> getLocationTags(java.lang.String search)
Find all location tags with matching names.

Parameters:
search - name to search
Returns:
List with all matching LocationTags

deleteLocationTag

void deleteLocationTag(LocationTag tag)
Completely remove the location tag from the database.

Parameters:
tag - The LocationTag to delete

getLocationByUuid

Location getLocationByUuid(java.lang.String uuid)
Parameters:
uuid - the uuid to look for
Returns:
location matching uuid

getLocationTagByUuid

LocationTag getLocationTagByUuid(java.lang.String uuid)
Parameters:
uuid -
Returns:

OpenMRS-1.7.x

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