From 010042cc947f35549fe880b473be6bfa7aec1a40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 7 Oct 2017 22:48:12 +0200 Subject: [PATCH] Continued a bit: - added timestamp when opening time has been created (the timestamp should be classically set in in EJB) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../opening_times/BusinessOpeningTimes.java | 23 ++++++++++++++++++- .../model/opening_times/OpeningTimes.java | 14 +++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/org/mxchange/jcontactsbusiness/model/opening_times/BusinessOpeningTimes.java b/src/org/mxchange/jcontactsbusiness/model/opening_times/BusinessOpeningTimes.java index 81af03c..241e817 100644 --- a/src/org/mxchange/jcontactsbusiness/model/opening_times/BusinessOpeningTimes.java +++ b/src/org/mxchange/jcontactsbusiness/model/opening_times/BusinessOpeningTimes.java @@ -56,10 +56,19 @@ public class BusinessOpeningTimes implements OpeningTimes { @Transient private static final long serialVersionUID = 19_578_871_756_871L; + /** + * When this opening time was created + */ + @Basic(optional = false) + @Column(name = "opening_times_created", nullable = false, updatable = false) + @Temporal (TemporalType.TIMESTAMP) + private Date openingCreated; + /** * Ending day of opening hours (if applyable) */ - @Column (name = "opening_times_end_day") + @Basic (optional = false) + @Column (name = "opening_times_end_day", nullable = false) @Enumerated (EnumType.STRING) private DayOfTheWeek openingEndDay; @@ -161,6 +170,18 @@ public class BusinessOpeningTimes implements OpeningTimes { return true; } + @Override + @SuppressWarnings ("ReturnOfDateField") + public Date getOpeningCreated () { + return this.openingCreated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setOpeningCreated (final Date openingCreated) { + this.openingCreated = openingCreated; + } + @Override public DayOfTheWeek getOpeningEndDay () { return this.openingEndDay; diff --git a/src/org/mxchange/jcontactsbusiness/model/opening_times/OpeningTimes.java b/src/org/mxchange/jcontactsbusiness/model/opening_times/OpeningTimes.java index 3278c9e..42c9f80 100644 --- a/src/org/mxchange/jcontactsbusiness/model/opening_times/OpeningTimes.java +++ b/src/org/mxchange/jcontactsbusiness/model/opening_times/OpeningTimes.java @@ -27,6 +27,20 @@ import org.mxchange.jcontactsbusiness.model.opening_times.dayofweek.DayOfTheWeek */ public interface OpeningTimes extends Serializable { + /** + * Getter for opening time created timestamp + *

+ * @return Opening time created timestamp + */ + Date getOpeningCreated (); + + /** + * Setter for opening time created timestamp + *

+ * @param openingCreated Opening time created timestamp + */ + void setOpeningCreated (final Date openingCreated); + /** * Getter for id number *

-- 2.39.5