示例#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);
 }