From: Roland Haeder Date: Mon, 11 Apr 2016 14:48:44 +0000 (+0200) Subject: Added named query for searching for a country based on country code or i18n key X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=406efb1791bb1437b0a88e6324a9d586c7af5064;p=jcountry-core.git Added named query for searching for a country based on country code or i18n key --- diff --git a/src/org/mxchange/jcountry/data/CountryData.java b/src/org/mxchange/jcountry/data/CountryData.java index 28bdaa6..073a8ce 100644 --- a/src/org/mxchange/jcountry/data/CountryData.java +++ b/src/org/mxchange/jcountry/data/CountryData.java @@ -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 {