]> git.mxchange.org Git - jphone-core.git/commitdiff
maybe not cascading fixes it?
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 12:06:31 +0000 (14:06 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 12:44:11 +0000 (14:44 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java
src/org/mxchange/jphone/phonenumbers/fax/FaxNumber.java
src/org/mxchange/jphone/phonenumbers/landline/LandLineNumber.java
src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java

index f092339e37b60aeae6a087e5299868241b378cc1..af396ba7824f4a8823f2d56976c5aca4f152f4a8 100644 (file)
 package org.mxchange.jphone.phonenumbers.cellphone;
 
 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;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider;
 import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
@@ -57,8 +56,7 @@ public class CellphoneNumber implements DialableCellphoneNumber, Comparable<Dial
         * Connection to table "cellphone_provider" (for dial prefix and more data)
         */
        @JoinColumn (name = "cellphone_provider_id", nullable = false)
-       @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.ALL, optional = false)
-       @Transient
+       @OneToOne (targetEntity = CellphoneProvider.class, optional = false, fetch = FetchType.EAGER)
        private SmsProvider cellphoneProvider;
 
        /**
index 54b395c6644ca97aee2fa95de4b8704d51802b7b..18520a798aba7b69c0cea73d513539572a2fc3d9 100644 (file)
 package org.mxchange.jphone.phonenumbers.fax;
 
 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;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
 
@@ -70,8 +69,7 @@ public class FaxNumber implements DialableFaxNumber, Comparable<DialableFaxNumbe
         * Country instance ('s dial data)
         */
        @JoinColumn (name = "fax_country_id", nullable = false)
-       @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL)
-       @Transient
+       @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
        private Country faxCountry;
 
        /**
index 0152bd18af81ce155cea501f8d44c9301db7e369..70285f71ea1e5b55d6f6764b1b084a81680c76ae 100644 (file)
 package org.mxchange.jphone.phonenumbers.landline;
 
 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;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
 
@@ -70,8 +69,7 @@ public class LandLineNumber implements DialableLandLineNumber, Comparable<Dialab
         * Connection to table "country_data"
         */
        @JoinColumn (name = "phone_country_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
-       @Transient
+       @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
        private Country phoneCountry;
 
        /**
index 08d3657204d453b3b3459b8f05bd009386515cb7..26dae625bda742cc8cabf96cbb0f1554267b4ae9 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jphone.phonenumbers.smsprovider;
 
 import javax.persistence.Basic;
-import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
@@ -75,8 +74,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, fetch = FetchType.EAGER)
-       private transient Country providerCountry;
+       @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER)
+       private Country providerCountry;
 
        @Override
        public Long getProviderId () {