From 406efb1791bb1437b0a88e6324a9d586c7af5064 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 11 Apr 2016 16:48:44 +0200 Subject: [PATCH] Added named query for searching for a country based on country code or i18n key --- src/org/mxchange/jcountry/data/CountryData.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 { -- 2.39.5