* 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;
* 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
+ * <p>
+ * @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
+ * <p>
+ * @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) {