]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
added missing headquarters entity relationship
authorRoland Haeder <roland@mxchange.org>
Wed, 21 Oct 2015 10:20:16 +0000 (12:20 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 21 Oct 2015 10:20:16 +0000 (12:20 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java
src/org/mxchange/jcontactsbusiness/employee/Employee.java

index cd051917d0c395fc46991bab5ddd536fc2525329..9f6b162d136d3548467e2a8e7867f48e5b548f96 100644 (file)
@@ -35,6 +35,8 @@ import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice;
 import org.mxchange.jcontactsbusiness.department.CompanyDepartment;
 import org.mxchange.jcontactsbusiness.department.Department;
+import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData;
+import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
 import org.mxchange.jcontactsbusiness.jobposition.EmployeePosition;
 import org.mxchange.jcontactsbusiness.jobposition.JobPosition;
 import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
@@ -55,12 +57,19 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        private static final long serialVersionUID = 48_959_819_859_812_076L;
 
        /**
-        * Branch office the employee works at
+        * Branch office (if the employee works there)
         */
        @JoinColumn (name = "employee_branch_id")
        @OneToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL)
        private BranchOffice employeeBranchOffice;
 
+       /**
+        * Head quarters id number (if the employee works there)
+        */
+       @JoinColumn (name = "employee_branch_id")
+       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL)
+       private HeadQuartersData employeeHeadquarter;
+
        /**
         * Company the employee is working at
         */
@@ -188,6 +197,16 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
                this.employeeEmailAddress = employeeEmailAddress;
        }
 
+       @Override
+       public HeadQuartersData getEmployeeHeadquarter () {
+               return this.employeeHeadquarter;
+       }
+
+       @Override
+       public void setEmployeeHeadquarter (final HeadQuartersData employeeHeadquarter) {
+               this.employeeHeadquarter = employeeHeadquarter;
+       }
+
        @Override
        public Long getEmployeeId () {
                return this.employeeId;
index daccb1dc6f63cd060f5a6214e08fec2aa63ac7af..f669ced4270ceb2babcc67efa08baab96d06e504 100644 (file)
@@ -21,6 +21,7 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontactsbusiness.BusinessContact;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.department.Department;
+import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
 import org.mxchange.jcontactsbusiness.jobposition.JobPosition;
 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 
@@ -73,6 +74,20 @@ public interface Employee extends Serializable {
         */
        void setEmployeeDepartment (final Department employeeDepartment);
 
+       /**
+        * Getter for employee's head quarters
+        * <p>
+        * @return Employee's head quarters
+        */
+       HeadQuartersData getEmployeeHeadquarter ();
+
+       /**
+        * Getter for employee's head quarters
+        * <p>
+        * @param employeeHeadquarter Employee's head quarters
+        */
+       void setEmployeeHeadquarter (final HeadQuartersData employeeHeadquarter);
+
        /**
         * Getter for employee's email address
         * <p>
@@ -172,8 +187,8 @@ public interface Employee extends Serializable {
        void setEmployeePosition (final JobPosition employeePosition);
 
        @Override
-        boolean equals (final Object object);
+       boolean equals (final Object object);
 
        @Override
-        int hashCode ();
+       int hashCode ();
 }