* Id number
*/
@Id
- @Column (name = "company_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "company_id", nullable = false, updatable = false)
@GeneratedValue (strategy = GenerationType.IDENTITY)
private Long companyContactId;
* Id number
*/
@Id
- @Column (name = "company_basic_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "company_basic_id", nullable = false, updatable = false)
@GeneratedValue (strategy = GenerationType.IDENTITY)
private Long companyBasicId;
* Legal status of company (example: "Inc.", "GmbH")
*/
@Basic (optional = false)
- @Column (name = "company_legal_status", length = 20, nullable = false)
+ @Column (name = "company_legal_status", nullable = false)
private String companyLegalStatus;
/**
*/
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "branch_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "branch_id", nullable = false, updatable = false)
private Long branchId;
/**
*/
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "department_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "department_id", nullable = false, updatable = false)
private Long departmentId;
/**
* Id number
*/
@Id
- @Column (name = "employee_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "employee_id", nullable = false, updatable = false)
@GeneratedValue (strategy = GenerationType.IDENTITY)
private Long employeeId;
public void setEmployeeUserOwner (final User employeeUserOwner) {
this.employeeUserOwner = employeeUserOwner;
}
+
}
*/
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "headquarters_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "headquarters_id", nullable = false, updatable = false)
private Long headquartersId;
/**
*/
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "job_position_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "job_position_id", nullable = false, updatable = false)
private Long jobPositionId;
/**
* Name/description of the job position (example: CEO)
*/
@Basic (optional = false)
- @Column (name = "job_position_name", length = 20, nullable = false, unique = true)
+ @Column (name = "job_position_name", nullable = false, unique = true)
private String jobPositionName;
@Override
*/
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "logo_id", length = 20, nullable = false, updatable = false)
+ @Column (name = "logo_id", nullable = false, updatable = false)
private Long logoId;
/**
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness.opening_times;
+
+import java.time.DayOfWeek;
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+/**
+ * A POJO for business opening hours
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Entity (name = "opening_times")
+@Table (name = "opening_times")
+public class BusinessOpeningTimes implements OpeningTimes {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 19_578_871_756_871L;
+
+ /**
+ * Ending day of opening hours (if applyable)
+ */
+ @Column (name = "opening_times_end_day")
+ @Enumerated (EnumType.STRING)
+ private DayOfWeek endDay;
+
+ /**
+ * Ending time (hh:mm)
+ */
+ @Basic (optional = false)
+ @Column (name = "opening_times_end_time")
+ @Temporal (TemporalType.TIME)
+ private Calendar endTime;
+
+ /**
+ * Id number
+ */
+ @Id
+ @Column (name = "opening_times_id", nullable = false, updatable = false)
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ /**
+ * Starting day of opening times
+ */
+ @Basic (optional = false)
+ @Column (name = "opening_times_start_day", nullable = false)
+ @Enumerated (EnumType.STRING)
+ private DayOfWeek startDay;
+
+ /**
+ * Starting time (hh:mm)
+ */
+ @Basic (optional = false)
+ @Column (name = "opening_times_start_time")
+ @Temporal (TemporalType.TIME)
+ private Calendar startTime;
+
+ @Override
+ public boolean equals (final Object obj) {
+ if (this == obj) {
+ return true;
+ } else if (obj == null) {
+ return false;
+ } else if (this.getClass() != obj.getClass()) {
+ return false;
+ }
+
+ final OpeningTimes openingTimes = (OpeningTimes) obj;
+
+ if (!Objects.equals(this.getId(), openingTimes.getId())) {
+ return false;
+ } else if (this.getStartDay() != openingTimes.getStartDay()) {
+ return false;
+ } else if (this.getEndDay() != openingTimes.getEndDay()) {
+ return false;
+ } else if (!Objects.equals(this.getStartTime(), openingTimes.getStartTime())) {
+ return false;
+ } else if (!Objects.equals(this.getEndTime(), openingTimes.getEndTime())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+
+ hash = 97 * hash + Objects.hashCode(this.getId());
+ hash = 97 * hash + Objects.hashCode(this.getStartDay());
+ hash = 97 * hash + Objects.hashCode(this.getEndDay());
+ hash = 97 * hash + Objects.hashCode(this.getStartTime());
+ hash = 97 * hash + Objects.hashCode(this.getEndTime());
+
+ return hash;
+ }
+
+ @Override
+ public DayOfWeek getEndDay () {
+ return this.endDay;
+ }
+
+ @Override
+ public void setEndDay (final DayOfWeek endDay) {
+ this.endDay = endDay;
+ }
+
+ @Override
+ public Calendar getEndTime () {
+ return this.endTime;
+ }
+
+ @Override
+ public void setEndTime (final Calendar endTime) {
+ this.endTime = endTime;
+ }
+
+ @Override
+ public Long getId () {
+ return this.id;
+ }
+
+ @Override
+ public void setId (Long id) {
+ this.id = id;
+ }
+
+ @Override
+ public DayOfWeek getStartDay () {
+ return this.startDay;
+ }
+
+ @Override
+ public void setStartDay (final DayOfWeek startDay) {
+ this.startDay = startDay;
+ }
+
+ @Override
+ public Calendar getStartTime () {
+ return this.startTime;
+ }
+
+ @Override
+ public void setStartTime (final Calendar startTime) {
+ this.startTime = startTime;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness.opening_times;
+
+import java.io.Serializable;
+import java.time.DayOfWeek;
+import java.util.Calendar;
+
+/**
+ * A POJI for opening times
+ *
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface OpeningTimes extends Serializable {
+
+ /**
+ * Getter for id number
+ * <p>
+ * @return Id number
+ */
+ Long getId ();
+
+ /**
+ * Setter for id number
+ * <p>
+ * @param id Id number
+ */
+ void setId (final Long id);
+
+ /**
+ * Getter for starting day
+ * <p>
+ * @return Starting day
+ */
+ DayOfWeek getStartDay ();
+
+ /**
+ * Setter for starting day
+ * <p>
+ * @param startDay Starting day
+ */
+ void setStartDay (final DayOfWeek startDay);
+
+ /**
+ * Getter for ending day
+ * <p>
+ * @return Ending day
+ */
+ DayOfWeek getEndDay ();
+
+ /**
+ * Setter for ending day
+ * <p>
+ * @param endDay Ending day
+ */
+ void setEndDay (final DayOfWeek endDay);
+
+ /**
+ * Getter for starting time
+ * <p>
+ * @return Starting time
+ */
+ Calendar getStartTime ();
+
+ /**
+ * Setter for starting time
+ * <p>
+ * @param startTime Starting time
+ */
+ void setStartTime (final Calendar startTime);
+
+ /**
+ * Getter for ending time
+ * <p>
+ * @return Ending time
+ */
+ Calendar getEndTime ();
+
+ /**
+ * Setter for ending time
+ * <p>
+ * @param endTime Ending time
+ */
+ void setEndTime (final Calendar endTime);
+
+ @Override
+ boolean equals (final Object obj);
+
+ @Override
+ int hashCode ();
+
+}