use of org.orcid.persistence.jpa.entities.CountryIsoEntity in project ORCID-Source by ORCID.
the class CountryManagerImpl method retrieveCountriesAndIsoCodes.
@Override
@Cacheable("iso-countries")
public Map<String, String> retrieveCountriesAndIsoCodes() {
List<CountryIsoEntity> countries = isoCountryReferenceDataDao.getAll();
Collections.sort(countries, new Comparator<CountryIsoEntity>() {
public int compare(CountryIsoEntity country1, CountryIsoEntity country2) {
return ((String) country1.getCountryName()).compareToIgnoreCase((String) country2.getCountryName());
}
});
Map<String, String> countriesMap = new LinkedHashMap<String, String>();
for (CountryIsoEntity country : countries) {
countriesMap.put(country.getCountryIsoCode(), country.getCountryName());
}
return countriesMap;
}
Aggregations