package org.mxchange.jphone.phonenumbers;
import java.io.Serializable;
+import org.mxchange.jcountry.data.Country;
/**
* A POJO for dialable numbers
*/
public interface DialableNumber extends Serializable {
+ /**
+ * Getter for country instance ('s dial data)
+ * <p>
+ * @return Country instance
+ */
+ public Country getCountry ();
+
+ /**
+ * Setter for country instance ('s dial data)
+ * <p>
+ * @param country Country instance
+ */
+ public void setCountry (final Country country);
+
/**
* Getter for id number
* <p>
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jcountry.data.CountryData;
import org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider;
import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
@Column (name = "cellphone_number", length = 20, nullable = false)
private Long phoneNumber;
+ /**
+ * Country instance ('s dial data)
+ */
+ @JoinColumn (name = "cellphone_country_id", nullable = false)
+ @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL)
+ private Country country;
+
@Override
public Long getPhoneId () {
return this.phoneId;
public int compareTo (final DialableCellphoneNumber dialableCellphoneNumber) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
+
+ @Override
+ public Country getCountry () {
+ return this.country;
+ }
+
+ @Override
+ public void setCountry (final Country country) {
+ this.country = country;
+ }
}
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.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
import javax.persistence.Table;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jcountry.data.CountryData;
/**
* A POJO for dialable fax numbers
* Id number
*/
@Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
@Column (name = "fax_id", length = 20, nullable = false, updatable = false)
private Long phoneId;
@Column (name = "fax_area_code", length = 10, nullable = false)
private Integer phoneAreaCode;
+ /**
+ * Country instance ('s dial data)
+ */
+ @JoinColumn (name = "fax_country_id", nullable = false)
+ @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL)
+ private Country country;
+
@Override
public Long getPhoneId () {
return this.phoneId;
this.phoneAreaCode = phoneAreaCode;
}
+ @Override
+ public Country getCountry () {
+ return this.country;
+ }
+
+ @Override
+ public void setCountry (final Country country) {
+ this.country = country;
+ }
+
}
/**
* Connection to table "country_data"
*/
- @JoinColumn(name = "phone_country_id", nullable = false, updatable = false)
- @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
- private Country phoneCountry;
+ @JoinColumn (name = "phone_country_id", nullable = false, updatable = false)
+ @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
+ private Country country;
@Override
public Long getPhoneId () {
public int compareTo (final DialableLandLineNumber dialableNumber) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
+
+ @Override
+ public Country getCountry () {
+ return this.country;
+ }
+
+ @Override
+ public void setCountry (final Country country) {
+ this.country = country;
+ }
}
*/
package org.mxchange.jphone.phonenumbers.smsprovider;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
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 org.mxchange.jcountry.data.Country;
+import org.mxchange.jcountry.data.CountryData;
/**
* A POJO for cellphone providers
*/
private String providerName;
+ /**
+ * Country instance ('s dial data)
+ */
+ @JoinColumn (name = "provider_country_id", nullable = false)
+ @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL)
+ private Country country;
+
@Override
public Long getProviderId () {
return providerId;
this.providerName = providerName;
}
+ @Override
+ public Country getCountry () {
+ return this.country;
+ }
+
+ @Override
+ public void setCountry (final Country country) {
+ this.country = country;
+ }
+
}
package org.mxchange.jphone.phonenumbers.smsprovider;
import java.io.Serializable;
+import org.mxchange.jcountry.data.Country;
/**
* A POJO for SMS provider
* @param providerName Provider name
*/
public void setProviderName (final String providerName);
+
+ /**
+ * Getter for country instance ('s dial data)
+ * <p>
+ * @return Country instance
+ */
+ public Country getCountry ();
+
+ /**
+ * Setter for country instance ('s dial data)
+ * <p>
+ * @param country Country instance
+ */
+ public void setCountry (final Country country);
}