package org.mxchange.jphone.phonenumbers;
import java.io.Serializable;
+import java.util.Calendar;
import org.mxchange.jcountry.data.Country;
/**
* @param phoneAreaCode Area code without dial prefix
*/
void setPhoneAreaCode (final Integer phoneAreaCode);
+
+ /**
+ * Getter for timestamp when this entry has been created
+ * <p>
+ * @return Timestamp when this entry has been created
+ */
+ Calendar getPhoneEntryCreated ();
+
+ /**
+ * Setter for timestamp when this entry has been created
+ * <p>
+ * @param phoneEntryCreated Timestamp when this entry has been created
+ */
+ void setPhoneEntryCreated (final Calendar phoneEntryCreated);
}
*/
package org.mxchange.jphone.phonenumbers.cellphone;
+import java.util.Calendar;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
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, fetch = FetchType.EAGER)
+ @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
private SmsProvider cellphoneProvider;
/**
@Column (name = "cellphone_number", length = 20, nullable = false)
private Long phoneNumber;
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "cellphone_entry_created", nullable = false, updatable = false)
+ private Calendar phoneEntryCreated;
+
/**
* Contructor with cellphone carrier and number
* <p>
* @param cellphoneCarrier Cellphone carrier instance
* @param cellphoneNumber Cellphone number
+ * @param phoneEntryCreated When this entry has been created
*/
- public CellphoneNumber (final SmsProvider cellphoneCarrier, final Long cellphoneNumber) {
+ public CellphoneNumber (final SmsProvider cellphoneCarrier, final Long cellphoneNumber, final Calendar phoneEntryCreated) {
this.cellphoneProvider = cellphoneCarrier;
this.phoneNumber = cellphoneNumber;
+ this.phoneEntryCreated = phoneEntryCreated;
}
/**
throw new UnsupportedOperationException("The country code is provided by SmsProvider."); //To change body of generated methods, choose Tools | Templates.
}
+ @Override
+ public Calendar getPhoneEntryCreated () {
+ return this.phoneEntryCreated;
+ }
+
+ @Override
+ public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
+ this.phoneEntryCreated = phoneEntryCreated;
+ }
+
@Override
public Long getPhoneId () {
return this.phoneId;
*/
package org.mxchange.jphone.phonenumbers.fax;
+import java.util.Calendar;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
import org.mxchange.jcountry.data.Country;
import org.mxchange.jcountry.data.CountryData;
*/
private static final long serialVersionUID = 17_687_687_191_375L;
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "fax_entry_created", nullable = false, updatable = false)
+ private Calendar phoneEntryCreated;
+
/**
* Id number
*/
* @param faxCountry Country instance
* @param faxAreaCode Area code (without leading zeros)
* @param faxNumber Fax number (without area code and leading zero)
+ * @param phoneEntryCreated When this entry has been created
*/
- public FaxNumber (final Country faxCountry, final Integer faxAreaCode, final Long faxNumber) {
+ public FaxNumber (final Country faxCountry, final Integer faxAreaCode, final Long faxNumber, final Calendar phoneEntryCreated) {
this.faxCountry = faxCountry;
this.faxAreaCode = faxAreaCode;
this.phoneNumber = faxNumber;
+ this.phoneEntryCreated = phoneEntryCreated;
}
/**
protected FaxNumber () {
}
- @Override
- public boolean equals (final Object object) {
- if (object == null) {
- return false;
- } else if (getClass() != object.getClass()) {
- return false;
- }
-
- final DialableFaxNumber other = (DialableFaxNumber) object;
-
- if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
- return false;
- } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
- return false;
- } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
- return false;
- }
-
- return true;
- }
-
@Override
public Long getPhoneId () {
return this.phoneId;
this.phoneNumber = phoneNumber;
}
- @Override
- public int compareTo (final DialableFaxNumber dialableFaxNumber) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
@Override
public Integer getPhoneAreaCode () {
return this.faxAreaCode;
this.faxCountry = faxCountry;
}
+ @Override
+ public Calendar getPhoneEntryCreated () {
+ return this.phoneEntryCreated;
+ }
+
+ @Override
+ public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
+ this.phoneEntryCreated = phoneEntryCreated;
+ }
+
+ @Override
+ public int compareTo (final DialableFaxNumber dialableFaxNumber) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableFaxNumber other = (DialableFaxNumber) object;
+
+ if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
+ return false;
+ }
+
+ return true;
+ }
+
@Override
public int hashCode () {
int hash = 3;
*/
package org.mxchange.jphone.phonenumbers.landline;
+import java.util.Calendar;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
import org.mxchange.jcountry.data.Country;
import org.mxchange.jcountry.data.CountryData;
*/
private static final long serialVersionUID = 18_563_748_781_956L;
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "phone_entry_created", nullable = false, updatable = false)
+ private Calendar phoneEntryCreated;
+
/**
* Id number
*/
* @param phoneCountry Country instance
* @param phoneAreaCode Phone area code
* @param phoneNumber Phone number
+ * @param phoneEntryCreated When this entry has been created
*/
- public LandLineNumber (final Country phoneCountry, final Integer phoneAreaCode, final Long phoneNumber) {
+ public LandLineNumber (final Country phoneCountry, final Integer phoneAreaCode, final Long phoneNumber, final Calendar phoneEntryCreated) {
this.phoneCountry = phoneCountry;
this.phoneAreaCode = phoneAreaCode;
this.phoneNumber = phoneNumber;
+ this.phoneEntryCreated = phoneEntryCreated;
}
/**
protected LandLineNumber () {
}
- @Override
- public boolean equals (Object object) {
- if (object == null) {
- return false;
- } else if (getClass() != object.getClass()) {
- return false;
- }
-
- final DialableLandLineNumber other = (DialableLandLineNumber) object;
-
- if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
- return false;
- } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
- return false;
- } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
- return false;
- }
-
- return true;
- }
-
@Override
public Long getPhoneId () {
return this.phoneId;
this.phoneAreaCode = phoneAreaCode;
}
- @Override
- public int compareTo (final DialableLandLineNumber dialableNumber) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
@Override
public Country getPhoneCountry () {
return this.phoneCountry;
this.phoneCountry = phoneCountry;
}
+ @Override
+ public Calendar getPhoneEntryCreated () {
+ return this.phoneEntryCreated;
+ }
+
+ @Override
+ public void setPhoneEntryCreated (final Calendar phoneEntryCreated) {
+ this.phoneEntryCreated = phoneEntryCreated;
+ }
+
+ @Override
+ public int compareTo (final DialableLandLineNumber dialableNumber) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean equals (Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final DialableLandLineNumber other = (DialableLandLineNumber) object;
+
+ if (!Objects.equals(this.getPhoneNumber(), other.getPhoneNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneAreaCode(), other.getPhoneAreaCode())) {
+ return false;
+ } else if (!Objects.equals(this.getPhoneCountry(), other.getPhoneCountry())) {
+ return false;
+ }
+
+ return true;
+ }
+
@Override
public int hashCode () {
int hash = 7;
*/
package org.mxchange.jphone.phonenumbers.smsprovider;
+import java.util.Calendar;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
import org.mxchange.jcountry.data.Country;
import org.mxchange.jcountry.data.CountryData;
@OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
private Country providerCountry;
- @Override
- public int compareTo (final SmsProvider provider) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public boolean equals (final Object object) {
- if (object == null) {
- return false;
- } else if (getClass() != object.getClass()) {
- return false;
- }
-
- final SmsProvider other = (SmsProvider) object;
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "provider_entry_created", nullable = false, updatable = false)
+ private Calendar providerEntryCreated;
- if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) {
- return false;
- } else if (!Objects.equals(this.getProviderName(), other.getProviderName())) {
- return false;
- } else if (!Objects.equals(this.getProviderCountry(), other.getProviderCountry())) {
- return false;
- }
+ /**
+ * Protected constructor for JPA
+ */
+ protected CellphoneProvider () {
+ }
- return true;
+ /**
+ * Constructor with all required data
+ * <p>
+ * @param providerDialPrefix Dial prefix
+ * @param providerName Name
+ * @param providerCountry Country
+ * @param providerEntryCreated When this entry has been created
+ */
+ public CellphoneProvider (final Long providerDialPrefix, final String providerName, final Country providerCountry, final Calendar providerEntryCreated) {
+ this.providerDialPrefix = providerDialPrefix;
+ this.providerName = providerName;
+ this.providerCountry = providerCountry;
+ this.providerEntryCreated = providerEntryCreated;
}
@Override
public Long getProviderId () {
- return providerId;
+ return this.providerId;
}
@Override
@Override
public Long getProviderDialPrefix () {
- return providerDialPrefix;
+ return this.providerDialPrefix;
}
@Override
@Override
public String getProviderName () {
- return providerName;
+ return this.providerName;
}
@Override
this.providerCountry = providerCountry;
}
+ @Override
+ public Calendar getProviderEntryCreated () {
+ return this.providerEntryCreated;
+ }
+
+ @Override
+ public void setProviderEntryCreated (final Calendar providerEntryCreated) {
+ this.providerEntryCreated = providerEntryCreated;
+ }
+
+ @Override
+ public int compareTo (final SmsProvider provider) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (object == null) {
+ return false;
+ } else if (getClass() != object.getClass()) {
+ return false;
+ }
+
+ final SmsProvider other = (SmsProvider) object;
+
+ if (!Objects.equals(this.getProviderDialPrefix(), other.getProviderDialPrefix())) {
+ return false;
+ } else if (!Objects.equals(this.getProviderName(), other.getProviderName())) {
+ return false;
+ } else if (!Objects.equals(this.getProviderCountry(), other.getProviderCountry())) {
+ return false;
+ }
+
+ return true;
+ }
+
@Override
public int hashCode () {
int hash = 7;
package org.mxchange.jphone.phonenumbers.smsprovider;
import java.io.Serializable;
+import java.util.Calendar;
import org.mxchange.jcountry.data.Country;
/**
*/
void setProviderCountry (final Country country);
+ /**
+ * Getter for timestamp when this entry has been created
+ * <p>
+ * @return Timestamp when this entry has been created
+ */
+ Calendar getProviderEntryCreated ();
+
+ /**
+ * Setter for timestamp when this entry has been created
+ * <p>
+ * @param providerEntryCreated Timestamp when this entry has been created
+ */
+ void setProviderEntryCreated (final Calendar providerEntryCreated);
+
@Override
boolean equals (final Object object);