]> git.mxchange.org Git - jphone-core.git/commitdiff
maybe this way? + renamed field
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 11:59:44 +0000 (13:59 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 11:59:44 +0000 (13:59 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java
src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java

index 409abad060f414dbf59ebd9dcb7af86ed73d8c46..08d3657204d453b3b3459b8f05bd009386515cb7 100644 (file)
@@ -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;
        }
 
 }
index fc096c1735ee8b1499937fc28c69ebc358bfdd86..65354f97ca17beac340247c55b98df9ebb04187a 100644 (file)
@@ -73,12 +73,12 @@ public interface SmsProvider extends Serializable {
         * <p>
         * @return Country instance
         */
-       public Country getCountry ();
+       public Country getProviderCountry ();
 
        /**
         * Setter for country instance ('s dial data)
         * <p>
         * @param country Country instance
         */
-       public void setCountry (final Country country);
+       public void setProviderCountry (final Country country);
 }