public class LocationDAO extends Object
| Constructor and Description | 
|---|
LocationDAO()  | 
| Modifier and Type | Method and Description | 
|---|---|
String | 
getLocationDescription(long id)
Gets the description of the dropoff location with the given ID 
 | 
Long | 
getLocationIdByDescription(Location location)
Looks up a location in the database by its description. 
 | 
ArrayList<Location> | 
getLocations()
Retrieves all locations from the database 
 | 
Location | 
insert(Location location)
Inserts a location into the database and updates the ID of the
 input location parameter. 
 | 
void | 
insertNewLocationRecord(Location location)
Inserts a new location record into the database, using description field
 in location input parameter. 
 | 
void | 
setInsertLocationSQL(String insertLocationSQL)
Used for Spring Dependency Injection 
 | 
void | 
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
Used for Spring Dependency Injection 
 | 
void | 
setLocationIds(ArrayList<Location> locations)
Walks input ArrayList, looking up and setting ID properties for
 each Location in the list. 
 | 
void | 
setResourceBundleMessageSource(org.springframework.context.support.ResourceBundleMessageSource resourceBundleMessageSource)
Used for Spring Dependency Injection 
 | 
void | 
setSelectAllLocationsSQL(String selectAllLocationsSQL)
Used for Spring Dependency Injection 
 | 
void | 
setSelectLocationOnDescriptionSQL(String selectLocationOnDescriptionSQL)
Used for Spring Dependency Injection 
 | 
public void setResourceBundleMessageSource(org.springframework.context.support.ResourceBundleMessageSource resourceBundleMessageSource)
public void setInsertLocationSQL(String insertLocationSQL)
public void setSelectAllLocationsSQL(String selectAllLocationsSQL)
public void setSelectLocationOnDescriptionSQL(String selectLocationOnDescriptionSQL)
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
jdbcTemplate - The jdbcTemplate to set.public Long getLocationIdByDescription(Location location) throws LibraryException
subject - Subject instance whose (trimmed) description field is
 used as the key in the lookupLibraryException - if subject is null or has null descriptionpublic void insertNewLocationRecord(Location location) throws LibraryException
subject - The new Subject to insertLibraryException - if required fields are missing or an SQL error
 occurspublic Location insert(Location location) throws LibraryException
location - The Location to insertLibraryException - if location is null or has null description
 or a database access error occurspublic String getLocationDescription(long id) throws LibraryException
id - ID of the locationLibraryException - if there is no location with the given ID or an exception occurs retrieving datapublic ArrayList<Location> getLocations() throws LibraryException
LibraryExceptionpublic void setLocationIds(ArrayList<Location> locations) throws LibraryException
locations - ArrayList of LocationsLibraryExceptionCopyright © 2003-2017 The Virtual Library Team. All Rights Reserved.