From e8abeef0df99c2cae93228b074eb77bfb454ee58 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 19 Feb 2016 19:25:36 +0100 Subject: [PATCH] Sorted members --- .../employee/CompanyEmployee.java | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java index c1c1680..34e6fa5 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java @@ -69,13 +69,6 @@ public class CompanyEmployee implements Employee, Comparable { @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 { @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 { @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 { @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 { 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 { 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 { 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; -- 2.39.5