From 3412dc5ba3168332b0baf482fd582d0e169e22f5 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 22 Oct 2015 10:10:03 +0200 Subject: [PATCH] =?utf8?q?added=20timestamp=20when=20the=20entry=20has=20b?= =?utf8?q?een=20created=20(administrative=20data)=20Signed-off-by:Roland?= =?utf8?q?=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/org/mxchange/jcountry/data/Country.java | 19 +++++++++++++++-- .../mxchange/jcountry/data/CountryData.java | 21 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) 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; -- 2.39.5