]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Thu, 7 Apr 2016 09:23:51 +0000 (11:23 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 7 Apr 2016 09:31:28 +0000 (11:31 +0200)
- added POJO/POJI for opening times
- size only applies for strings, no need here (cleanup)
- updated jar(s)

14 files changed:
lib/jcontacts-core.jar
lib/jcountry-core.jar
lib/jphone-core.jar
lib/juser-core.jar
src/org/mxchange/jcontactsbusiness/CompanyContact.java
src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java
src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java
src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java
src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java
src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java
src/org/mxchange/jcontactsbusiness/jobposition/EmployeePosition.java
src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java
src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/opening_times/OpeningTimes.java [new file with mode: 0644]

index 6c00138861dd02dae05115842913099b8f9d10f7..59559efe241a09d9c37e438697cafbb84fa98ae1 100644 (file)
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
index 49be2e4aa7b60c8ea2109ed5fbe2002af4911630..01a8041b9818458cfcaf5783e01d872b7be6d95c 100644 (file)
Binary files a/lib/jcountry-core.jar and b/lib/jcountry-core.jar differ
index c997cecc6f5630b8b2bb4b4420787610650dc450..be67aae9533634e3354ff8cb71c1428268e64e72 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index 7a5f4c53513c18407f787533376971a2847632d3..5d51db160dd34f57e4396d21845d8b83d6ca675d 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index 3642930de6d2e12f5e79cf75aa515151700022b7..aed29bb02f34ac631e430b4bc0587ff2b688c4ea 100644 (file)
@@ -80,7 +80,7 @@ public class CompanyContact implements BusinessContact {
         * 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;
 
index ca92223afa8b398a1c4ded0188f6089ba7e2f9c3..fcae00ab6d75d07f196d05b070ed814f52ed9980 100644 (file)
@@ -73,7 +73,7 @@ public class CompanyBasicData implements BusinessBasicData {
         * 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;
 
@@ -101,7 +101,7 @@ public class CompanyBasicData implements BusinessBasicData {
         * 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;
 
        /**
index 062b78102f553f111e818f88c19f03dced079a2b..f6126f240d719597f57e4a92d25fcc3d12d5f572 100644 (file)
@@ -108,7 +108,7 @@ public class CompanyBranchOffice implements BranchOffice {
         */
        @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;
 
        /**
index 2ef70403ca84a254619291e2d52e95d44ed4fb9b..093d9c4f2c64cfdce11ea942e89debe62580147e 100644 (file)
@@ -90,7 +90,7 @@ public class CompanyDepartment implements Department {
         */
        @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;
 
        /**
index 3b33f6c8888b480b0bff9737653f985ce6404234..221d48130a455727681de3d3c28bc0da043a8e5e 100644 (file)
@@ -107,7 +107,7 @@ public class CompanyEmployee implements Employee {
         * 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;
 
@@ -310,4 +310,5 @@ public class CompanyEmployee implements Employee {
        public void setEmployeeUserOwner (final User employeeUserOwner) {
                this.employeeUserOwner = employeeUserOwner;
        }
+
 }
index 87166fe066c9e738e2901701d4f35d2446ef1bfe..190b9733a414637c242fb85732ea0f53d37c580a 100644 (file)
@@ -94,7 +94,7 @@ public class CompanyHeadQuartersData implements HeadQuartersData {
         */
        @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;
 
        /**
index 6ebfcb96253f7c02cfeece538a511a83ed3fd9da..29d013bbdc545d668facc8e2e0a2beb5dfb2446e 100644 (file)
@@ -61,14 +61,14 @@ public class EmployeePosition implements JobPosition {
         */
        @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
index 3b98382c3ce7cb28a616052a3ce261c88a981dea..447af3f504fa6eac2a649dc2232b71d247f2701e 100644 (file)
@@ -67,7 +67,7 @@ public class CompanyLogo implements BusinessLogo {
         */
        @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;
 
        /**
diff --git a/src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java b/src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java
new file mode 100644 (file)
index 0000000..e030964
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * 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;
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/opening_times/OpeningTimes.java b/src/org/mxchange/jcontactsbusiness/opening_times/OpeningTimes.java
new file mode 100644 (file)
index 0000000..5b6c3fe
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * 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 ();
+
+}