From: Roland Haeder Date: Mon, 12 Oct 2015 11:59:44 +0000 (+0200) Subject: maybe this way? + renamed field X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f021e05397147a3cc5911ec0a8e6788968670ff2;p=jphone-core.git maybe this way? + renamed field Signed-off-by:Roland Häder --- 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); }