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;
* 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;
/**
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;
* 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;
/**
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;
* 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;
/**
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;
* 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 () {