]> git.mxchange.org Git - jcountry-core.git/commitdiff
Added named query for searching for a country based on country code or i18n key
authorRoland Haeder <roland@mxchange.org>
Mon, 11 Apr 2016 14:48:44 +0000 (16:48 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 11 Apr 2016 14:48:44 +0000 (16:48 +0200)
src/org/mxchange/jcountry/data/CountryData.java

index 28bdaa6b73a99f00984aa7820179181503a17b69..073a8ced040e57d81f9a0f9c79cd9d35c3d5c84c 100644 (file)
@@ -38,7 +38,10 @@ import javax.persistence.TemporalType;
 @Entity (name = "country_data")
 @Table (name = "country_data")
 @NamedQueries (
-               @NamedQuery (name = "AllCountries", query = "SELECT c FROM country_data AS c ORDER BY c.countryId ASC")
+               {
+                       @NamedQuery (name = "AllCountries", query = "SELECT c FROM country_data AS c ORDER BY c.countryId ASC"),
+                       @NamedQuery (name = "SearchCountryByCodeI18nKey", query = "SELECT c FROM country_data AS c WHERE c.countryCode = :code OR c.countryI18nkey = :key")
+               }
 )
 public class CountryData implements Country {