예제 #1
0
 @Override
 public List<Country> getCountries() {
   Search searchCriteria = new Search(Country.class);
   searchCriteria.addSortAsc("name");
   List<Country> countries = countryDAO.search(searchCriteria);
   return countries;
 }
예제 #2
0
 /**
  * retuns a country with the given name, null otherwise
  *
  * @param countryName
  * @return
  */
 private Country findCountryByName(String name) {
   Search searchCriteria = new Search(Country.class);
   searchCriteria.addFilterEqual("name", name);
   List<Country> countries = countryDAO.search(searchCriteria);
   if (countries.size() > 0) {
     return countries.get(0);
   }
   return null;
 }
예제 #3
0
 @Override
 public Country findCountryByISO3(String iso3) {
   Search searchCriteria = new Search(Country.class);
   searchCriteria.addFilterEqual("iso3", iso3);
   List<Country> countries = countryDAO.search(searchCriteria);
   if (countries.size() > 0) {
     return countries.get(0);
   }
   return null;
 }
예제 #4
0
  @Override
  public Country findCountry(Long id) {

    return countryDAO.find(id);
  }
예제 #5
0
 /* (non-Javadoc)
  * @see it.geosolutions.fra2015.services.SurveyService#searchCountry(java.lang.String)
  */
 @Override
 public Country searchCountry(String iso3) {
   Search searchCriteria = new Search(Country.class);
   searchCriteria.addFilterEqual("iso3", iso3);
   return countryDAO.search(searchCriteria).get(0);
 }