]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 10 May 2020 04:52:14 +0000 (06:52 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 10 May 2020 04:53:53 +0000 (06:53 +0200)
- also had to change it for branch offices (both references)

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java
src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java
src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java

index 4795de994c1506f5d41a2401a1c3215aca2c0f49..0a41bd1669f6e4b3fcf7181e0014369b46c08865 100644 (file)
@@ -19,8 +19,8 @@ package org.mxchange.jcontactsbusiness.model.branchoffice;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
+import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
@@ -203,18 +203,18 @@ public interface BranchOffice extends Comparable<BranchOffice>, Serializable {
        void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes);
 
        /**
-        * Getter for branch office owning employee
+        * Getter for branch office owning contact
         * <p>
-        * @return Owning employee
+        * @return Owning contact
         */
-       Employable getBranchOwnerEmployee ();
+       Contact getBranchOwnerEmployee ();
 
        /**
-        * Setter for branch office owning employee
+        * Setter for branch office owning contact
         * <p>
-        * @param branchOwnerEmployee Owning employee
+        * @param branchOwnerEmployee Owning contact
         */
-       void setBranchOwnerEmployee (final Employable branchOwnerEmployee);
+       void setBranchOwnerEmployee (final Contact branchOwnerEmployee);
 
        /**
         * Getter for branch office's ZIP code
@@ -277,14 +277,14 @@ public interface BranchOffice extends Comparable<BranchOffice>, Serializable {
         * <p>
         * @return Branch office's contact person
         */
-       Employable getBranchContactEmployee ();
+       Contact getBranchContactEmployee ();
 
        /**
         * Setter branch office's contact person
         * <p>
         * @param branchEmployee Branch office's contact person
         */
-       void setBranchContactEmployee (final Employable branchEmployee);
+       void setBranchContactEmployee (final Contact branchEmployee);
 
        /**
         * Getter for user owner instance
index 5d8f272831c32457a739fbccdce081c85814e9d6..01b4b5df0c07df183d056df9b12adf075121fcf3 100644 (file)
@@ -39,11 +39,11 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 import org.apache.commons.lang3.StringUtils;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.Contacts;
+import org.mxchange.jcontacts.model.contact.UserContact;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.employee.Employees;
 import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcoreutils.Comparables;
@@ -96,9 +96,9 @@ public class BusinessBranchOffice implements BranchOffice {
        /**
         * Reference to contact person
         */
-       @JoinColumn (name = "branch_contact_employee_id", referencedColumnName = "employee_id")
-       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.REFRESH)
-       private Employable branchContactEmployee;
+       @JoinColumn (name = "branch_contact_employee_id", referencedColumnName = "contact_id")
+       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
+       private Contact branchContactEmployee;
 
        /**
         * Branch office's country code
@@ -199,9 +199,9 @@ public class BusinessBranchOffice implements BranchOffice {
         * will have an owning person (here generally referred as "employee") who
         * will own one or more branch offices.
         */
-       @JoinColumn (name = "branch_owner_employee_id", referencedColumnName = "employee_id")
-       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.REFRESH)
-       private Employable branchOwnerEmployee;
+       @JoinColumn (name = "branch_owner_employee_id", referencedColumnName = "contact_id")
+       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
+       private Contact branchOwnerEmployee;
 
        /**
         * Branch office's store (if multiple-store building)
@@ -329,9 +329,9 @@ public class BusinessBranchOffice implements BranchOffice {
                        // ... branch office number
                        SafeNumberUtils.compare(this.getBranchNumber(), branchOffice.getBranchNumber()),
                        // ... owner employee
-                       Employees.compare(this.getBranchOwnerEmployee(), branchOffice.getBranchOwnerEmployee()),
+                       Contacts.compare(this.getBranchOwnerEmployee(), branchOffice.getBranchOwnerEmployee()),
                        // ... contact person
-                       Employees.compare(this.getBranchContactEmployee(), branchOffice.getBranchContactEmployee()),
+                       Contacts.compare(this.getBranchContactEmployee(), branchOffice.getBranchContactEmployee()),
                        // ... then country
                        this.getBranchCountry().compareTo(branchOffice.getBranchCountry()),
                        // ... next city
@@ -376,6 +376,8 @@ public class BusinessBranchOffice implements BranchOffice {
                        return false;
                } else if (!Objects.equals(this.getBranchCompany(), branchOffice.getBranchCompany())) {
                        return false;
+               } else if (!Objects.equals(this.getBranchContactEmployee(), branchOffice.getBranchContactEmployee())) {
+                       return false;
                } else if (!Objects.equals(this.getBranchCountry(), branchOffice.getBranchCountry())) {
                        return false;
                } else if (!Objects.equals(this.getBranchEmailAddress(), branchOffice.getBranchEmailAddress())) {
@@ -392,6 +394,8 @@ public class BusinessBranchOffice implements BranchOffice {
                        return false;
                } else if (!Objects.equals(this.getBranchNumber(), branchOffice.getBranchNumber())) {
                        return false;
+               } else if (!Objects.equals(this.getBranchOwnerEmployee(), branchOffice.getBranchOwnerEmployee())) {
+                       return false;
                } else if (!Objects.equals(this.getBranchStore(), branchOffice.getBranchStore())) {
                        return false;
                } else if (!Objects.equals(this.getBranchStreet(), branchOffice.getBranchStreet())) {
@@ -428,12 +432,12 @@ public class BusinessBranchOffice implements BranchOffice {
        }
 
        @Override
-       public Employable getBranchContactEmployee () {
+       public Contact getBranchContactEmployee () {
                return this.branchContactEmployee;
        }
 
        @Override
-       public void setBranchContactEmployee (final Employable branchContactEmployee) {
+       public void setBranchContactEmployee (final Contact branchContactEmployee) {
                this.branchContactEmployee = branchContactEmployee;
        }
 
@@ -564,12 +568,12 @@ public class BusinessBranchOffice implements BranchOffice {
        }
 
        @Override
-       public Employable getBranchOwnerEmployee () {
+       public Contact getBranchOwnerEmployee () {
                return this.branchOwnerEmployee;
        }
 
        @Override
-       public void setBranchOwnerEmployee (final Employable branchOwnerEmployee) {
+       public void setBranchOwnerEmployee (final Contact branchOwnerEmployee) {
                this.branchOwnerEmployee = branchOwnerEmployee;
        }
 
@@ -629,6 +633,7 @@ public class BusinessBranchOffice implements BranchOffice {
 
                hash = 53 * hash + Objects.hashCode(this.getBranchCity());
                hash = 53 * hash + Objects.hashCode(this.getBranchCompany());
+               hash = 53 * hash + Objects.hashCode(this.getBranchContactEmployee());
                hash = 53 * hash + Objects.hashCode(this.getBranchCountry());
                hash = 53 * hash + Objects.hashCode(this.getBranchEmailAddress());
                hash = 53 * hash + Objects.hashCode(this.getBranchFaxNumber());
@@ -638,6 +643,7 @@ public class BusinessBranchOffice implements BranchOffice {
                hash = 53 * hash + Objects.hashCode(this.getBranchLandLineNumber());
                hash = 53 * hash + Objects.hashCode(this.getBranchLastHouseNumber());
                hash = 53 * hash + Objects.hashCode(this.getBranchNumber());
+               hash = 53 * hash + Objects.hashCode(this.getBranchOwnerEmployee());
                hash = 53 * hash + Objects.hashCode(this.getBranchStore());
                hash = 53 * hash + Objects.hashCode(this.getBranchStreet());
                hash = 53 * hash + Objects.hashCode(this.getBranchSuiteNumber());
index d066b594c953b6e296b2a97b71ef05f021998a60..46201ff1ff15515906b80fafd70ce41953831d7a 100644 (file)
@@ -123,7 +123,7 @@ public class BusinessDepartment implements Department {
        /**
         * Department lead contact data
         */
-       @JoinColumn (name = "department_lead_id")
+       @JoinColumn (name = "department_lead_id", referencedColumnName = "contact_id")
        @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
        private Contact departmentLead;