From: Roland Haeder Date: Thu, 7 Apr 2016 10:34:21 +0000 (+0200) Subject: added constructors and made endTime/startTime not nullable X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=22e056fa4ead231eb804d3cea02dd098b75c30fb;p=jcontacts-business-core.git added constructors and made endTime/startTime not nullable --- diff --git a/src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java b/src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java index bffed5d..f11ea40 100644 --- a/src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java +++ b/src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java @@ -56,7 +56,7 @@ public class BusinessOpeningTimes implements OpeningTimes { * Ending time (hh:mm) */ @Basic (optional = false) - @Column (name = "opening_times_end_time") + @Column (name = "opening_times_end_time", nullable = false) @Temporal (TemporalType.TIME) private Calendar endTime; @@ -80,10 +80,49 @@ public class BusinessOpeningTimes implements OpeningTimes { * Starting time (hh:mm) */ @Basic (optional = false) - @Column (name = "opening_times_start_time") + @Column (name = "opening_times_start_time", nullable = false) @Temporal (TemporalType.TIME) private Calendar startTime; + /** + * Default constructor + */ + public BusinessOpeningTimes () { + } + + /** + * Constructor with all field + *

+ * @param endDay End day + * @param endTime End time + * @param id Id number + * @param startDay Start day + * @param startTime Start time + */ + public BusinessOpeningTimes (final DayOfWeek endDay, final Calendar endTime, final Long id, final DayOfWeek startDay, final Calendar startTime) { + // Call other constructor + this(endDay, endTime, startDay, startTime); + + // Set id number + this.id = id; + } + + /** + * Constructor with all fields except id number + *

+ * @param endDay End day + * @param endTime End time + * @param startDay Start day + * @param startTime Start time + */ + public BusinessOpeningTimes (final DayOfWeek endDay, final Calendar endTime, final DayOfWeek startDay, final Calendar startTime) { + // Set all fields + this.endDay = endDay; + this.endTime = endTime; + this.startDay = startDay; + this.startTime = startTime; + } + @Override public boolean equals (final Object obj) { if (this == obj) {