From: Roland Haeder Date: Thu, 22 Oct 2015 08:10:03 +0000 (+0200) Subject: added timestamp when the entry has been created (administrative data) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3412dc5ba3168332b0baf482fd582d0e169e22f5;p=jcountry-core.git added timestamp when the entry has been created (administrative data) Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jcountry/data/Country.java b/src/org/mxchange/jcountry/data/Country.java index 249b0e2..3aee8f2 100644 --- a/src/org/mxchange/jcountry/data/Country.java +++ b/src/org/mxchange/jcountry/data/Country.java @@ -17,6 +17,7 @@ package org.mxchange.jcountry.data; import java.io.Serializable; +import java.util.Calendar; /** * A POJI for country data such as dial prefixes @@ -124,9 +125,23 @@ public interface Country extends Serializable { */ void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired); + /** + * Getter for country entry created timestamp + *

+ * @return Country entry created timestamp + */ + Calendar getCountryEntryCreated (); + + /** + * Setter for country entry created timestamp + *

+ * @param countryEntryCreated Country entry created timestamp + */ + void setCountryEntryCreated (final Calendar countryEntryCreated); + @Override - boolean equals (final Object object); + boolean equals (final Object object); @Override - int hashCode (); + int hashCode (); } diff --git a/src/org/mxchange/jcountry/data/CountryData.java b/src/org/mxchange/jcountry/data/CountryData.java index b286d71..f69c647 100644 --- a/src/org/mxchange/jcountry/data/CountryData.java +++ b/src/org/mxchange/jcountry/data/CountryData.java @@ -16,6 +16,7 @@ */ package org.mxchange.jcountry.data; +import java.util.Calendar; import java.util.Objects; import javax.persistence.Basic; import javax.persistence.Column; @@ -26,6 +27,8 @@ import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; /** * A POJO for country data @@ -99,6 +102,14 @@ public class CountryData implements Country, Comparable { @Column (name = "country_is_local_prefix_required", nullable = false) private Boolean countryIsLocalPrefixRequired; + /** + * TImestamp when this entry has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "country_entry_created", nullable = false, updatable = false) + private Calendar countryEntryCreated; + @Override public boolean equals (final Object object) { if (object == null) { @@ -112,6 +123,16 @@ public class CountryData implements Country, Comparable { return Objects.equals(this.getCountryCode(), other.getCountryCode()); } + @Override + public Calendar getCountryEntryCreated () { + return this.countryEntryCreated; + } + + @Override + public void setCountryEntryCreated (final Calendar countryEntryCreated) { + this.countryEntryCreated = countryEntryCreated; + } + @Override public Short getCountryPhoneCode () { return this.countryPhoneCode;