|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mycompany.service.impl.AbstractService
com.mycompany.service.impl.CountryServiceImpl
@Named(value="countryService") public class CountryServiceImpl
Country service implementation class.
Constructor Summary | |
---|---|
CountryServiceImpl()
|
Method Summary | |
---|---|
ProvinceState |
createProvinceState(Country country,
java.lang.String name)
Creates a ProvinceState object for a particular Country . |
java.util.List<City> |
findCitiesByState(ProvinceState state)
Finds a list of City objects for the given ProvinceState . |
City |
findCity(java.lang.String name,
ProvinceState provinceState)
Finds a City by name in the ProvinceState . |
City |
findCityById(java.lang.Integer id)
Finds a City object by ID. |
Country |
findCountryById(java.lang.Integer id)
Finds a Country object by ID. |
java.util.List<ProvinceState> |
findProvinceStatesByCountry(Country country)
Finds a List of ProvinceState objects for a particular
Country . |
ProvinceState |
findStateById(java.lang.Integer id)
Finds a ProvinceState object by ID. |
ProvinceState |
findStateByName(Country country,
java.lang.String stateName)
Finds a ProvinceState object by name within a particular
Country . |
java.util.List<Country> |
getCountries()
Returns all Country objects. |
java.util.List<ProvinceState> |
getProvinceStates()
Returns all ProvinceState objects. |
void |
init(javax.servlet.ServletContext context)
Invoked during the ServletContext initialization to populate the
database with sample data. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CountryServiceImpl()
Method Detail |
---|
public ProvinceState createProvinceState(Country country, java.lang.String name)
ProvinceState
object for a particular Country
.
createProvinceState
in interface CountryService
country
- The Country in which the ProvinceState is located.name
- The name of the ProvinceState.
public java.util.List<City> findCitiesByState(ProvinceState state)
City
objects for the given ProvinceState
.
findCitiesByState
in interface CountryService
state
- The ProvinceState object for which to find cities.
public City findCity(java.lang.String name, ProvinceState provinceState)
City
by name in the ProvinceState
.
findCity
in interface CountryService
name
- The name of the city.provinceState
- The province/state in which to find the city.
public City findCityById(java.lang.Integer id)
City
object by ID.
findCityById
in interface CountryService
id
- The ID of the city.
public Country findCountryById(java.lang.Integer id)
Country
object by ID.
findCountryById
in interface CountryService
id
- The ID of the country.
public java.util.List<ProvinceState> findProvinceStatesByCountry(Country country)
List
of ProvinceState
objects for a particular
Country
.
findProvinceStatesByCountry
in interface CountryService
country
- The Country object.
public ProvinceState findStateById(java.lang.Integer id)
ProvinceState
object by ID.
findStateById
in interface CountryService
id
- The ID of the ProvinceState object.
public ProvinceState findStateByName(Country country, java.lang.String stateName)
ProvinceState
object by name within a particular
Country
.
findStateByName
in interface CountryService
country
- The Country object.stateName
- The name of the ProvinceState to find.
public java.util.List<Country> getCountries()
Country
objects.
getCountries
in interface CountryService
public java.util.List<ProvinceState> getProvinceStates()
ProvinceState
objects.
getProvinceStates
in interface CountryService
public void init(@Observes javax.servlet.ServletContext context) throws java.lang.Exception
ServletContext
initialization to populate the
database with sample data.
init
in interface CountryService
context
- The ServletContext
object.
java.lang.Exception
- If something goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |