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.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;
* 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 () {
}
@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;
}
}
* <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);
}