From f021e05397147a3cc5911ec0a8e6788968670ff2 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 13:59:44 +0200 Subject: [PATCH] =?utf8?q?maybe=20this=20way=3F=20+=20renamed=20field=20Si?= =?utf8?q?gned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../smsprovider/CellphoneProvider.java | 15 +++++++-------- .../phonenumbers/smsprovider/SmsProvider.java | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java index 409abad..08d3657 100644 --- a/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java @@ -20,6 +20,7 @@ import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -28,7 +29,6 @@ import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToOne; import javax.persistence.Table; -import javax.persistence.Transient; import org.mxchange.jcountry.data.Country; import org.mxchange.jcountry.data.CountryData; @@ -75,9 +75,8 @@ public class CellphoneProvider implements SmsProvider { * Country instance ('s dial data) */ @JoinColumn (name = "provider_country_id", nullable = false) - @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL) - @Transient - private Country country; + @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + private transient Country providerCountry; @Override public Long getProviderId () { @@ -110,13 +109,13 @@ public class CellphoneProvider implements SmsProvider { } @Override - public Country getCountry () { - return this.country; + public Country getProviderCountry () { + return this.providerCountry; } @Override - public void setCountry (final Country country) { - this.country = country; + public void setProviderCountry (final Country providerCountry) { + this.providerCountry = providerCountry; } } diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java index fc096c1..65354f9 100644 --- a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java @@ -73,12 +73,12 @@ public interface SmsProvider extends Serializable { *

* @return Country instance */ - public Country getCountry (); + public Country getProviderCountry (); /** * Setter for country instance ('s dial data) *

* @param country Country instance */ - public void setCountry (final Country country); + public void setProviderCountry (final Country country); } -- 2.39.5