]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Sorted members
authorRoland Haeder <roland@mxchange.org>
Fri, 19 Feb 2016 18:25:36 +0000 (19:25 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 19 Feb 2016 18:25:36 +0000 (19:25 +0100)
src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java

index c1c1680e8e840cfd39f4bf7cfff646820bfc055c..34e6fa512fdf2123d869ba29391f8b872397e85b 100644 (file)
@@ -69,13 +69,6 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        @OneToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL)
        private BranchOffice employeeBranchOffice;
 
-       /**
-        * Head quarters id number (if the employee works there)
-        */
-       @JoinColumn (name = "employee_headquarters_id")
-       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL)
-       private HeadQuartersData employeeHeadquarter;
-
        /**
         * Company the employee is working at
         */
@@ -83,6 +76,14 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false)
        private BusinessContact employeeCompany;
 
+       /**
+        * Timestamp when this entry has been created
+        */
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "employee_entry_created", nullable = false, updatable = false)
+       private Calendar employeeCreated;
+
        /**
         * Department the employee works at
         */
@@ -96,6 +97,13 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        @Column (name = "employee_email_address", length = 30)
        private String employeeEmailAddress;
 
+       /**
+        * Head quarters id number (if the employee works there)
+        */
+       @JoinColumn (name = "employee_headquarters_id")
+       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL)
+       private HeadQuartersData employeeHeadquarter;
+
        /**
         * Id number
         */
@@ -144,13 +152,31 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false)
        private User employeeUserOwner;
 
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "employee_entry_created", nullable = false, updatable = false)
-       private Calendar employeeCreated;
+       @Override
+       public int compareTo (final Employee employee) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public boolean equals (final Object object) {
+               if (object == null) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final Employee other = (Employee) object;
+
+               if (!Objects.equals(this.getEmployeeCompany(), other.getEmployeeCompany())) {
+                       return false;
+               } else if (!Objects.equals(this.getEmployeeNumber(), other.getEmployeeNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getEmployeePersonalData(), other.getEmployeePersonalData())) {
+                       return false;
+               }
+
+               return true;
+       }
 
        @Override
        public BranchOffice getEmployeeBranchOffice () {
@@ -172,6 +198,16 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
                this.employeeCompany = employeeCompany;
        }
 
+       @Override
+       public Calendar getEmployeeCreated () {
+               return this.employeeCreated;
+       }
+
+       @Override
+       public void setEmployeeCreated (final Calendar employeeCreated) {
+               this.employeeCreated = employeeCreated;
+       }
+
        @Override
        public Department getEmployeeDepartment () {
                return this.employeeDepartment;
@@ -262,16 +298,6 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
                this.employeePosition = employeePosition;
        }
 
-       @Override
-       public Calendar getEmployeeCreated () {
-               return this.employeeCreated;
-       }
-
-       @Override
-       public void setEmployeeCreated (final Calendar employeeCreated) {
-               this.employeeCreated = employeeCreated;
-       }
-
        @Override
        public User getEmployeeUserOwner () {
                return this.employeeUserOwner;
@@ -282,32 +308,6 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
                this.employeeUserOwner = employeeUserOwner;
        }
 
-       @Override
-       public int compareTo (final Employee employee) {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (object == null) {
-                       return false;
-               } else if (getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final Employee other = (Employee) object;
-
-               if (!Objects.equals(this.getEmployeeCompany(), other.getEmployeeCompany())) {
-                       return false;
-               } else if (!Objects.equals(this.getEmployeeNumber(), other.getEmployeeNumber())) {
-                       return false;
-               } else if (!Objects.equals(this.getEmployeePersonalData(), other.getEmployeePersonalData())) {
-                       return false;
-               }
-
-               return true;
-       }
-
        @Override
        public int hashCode () {
                int hash = 3;