From: Roland Haeder Date: Sat, 20 Feb 2016 19:08:24 +0000 (+0100) Subject: resorted members + added this. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2e07d7eced00b394dfade15339bf4a14e19ae067;p=jcontacts-business-core.git resorted members + added this. --- diff --git a/src/org/mxchange/jcontactsbusiness/CompanyContact.java b/src/org/mxchange/jcontactsbusiness/CompanyContact.java index 2319949..4da8d33 100644 --- a/src/org/mxchange/jcontactsbusiness/CompanyContact.java +++ b/src/org/mxchange/jcontactsbusiness/CompanyContact.java @@ -54,7 +54,7 @@ public class CompanyContact implements BusinessContact, Comparable { private static final long serialVersionUID = 94_835_918_958_717_660L; /** - * Connection to company contact + * Where this department is located */ - @JoinColumn (name = "department_company_id", nullable = false, updatable = false) - @ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER) - private BusinessContact departmentCompany; + @JoinColumn (name = "department_headquarters_id") + @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL) + private HeadQuartersData departentHeadquarters; /** * Where this department is located @@ -72,11 +72,19 @@ public class CompanyDepartment implements Department, Comparable { private BranchOffice departmentBranchOffice; /** - * Where this department is located + * Connection to company contact */ - @JoinColumn (name = "department_headquarters_id") - @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL) - private HeadQuartersData departentHeadquarters; + @JoinColumn (name = "department_company_id", nullable = false, updatable = false) + @ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER) + private BusinessContact departmentCompany; + + /** + * Timestamp when this entry has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "department_entry_created", nullable = false, updatable = false) + private Calendar departmentCreated; /** * Id number @@ -107,13 +115,37 @@ public class CompanyDepartment implements Department, Comparable { @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false) private User departmentUserOwner; - /** - * Timestamp when this entry has been created - */ - @Basic (optional = false) - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "department_entry_created", nullable = false, updatable = false) - private Calendar departmentCreated; + @Override + public int compareTo (final Department department) { + 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 Department other = (Department) object; + + if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) { + return false; + } else if (!Objects.equals(this.getDepartmentName(), other.getDepartmentName())) { + return false; + } + + return true; + } + + @Override + public int hashCode () { + int hash = 5; + hash = 53 * hash + Objects.hashCode(this.getDepartmentCompany()); + hash = 53 * hash + Objects.hashCode(this.getDepartmentName()); + return hash; + } @Override public HeadQuartersData getDepartentHeadquarters () { @@ -145,6 +177,16 @@ public class CompanyDepartment implements Department, Comparable { this.departmentCompany = departmentCompany; } + @Override + public Calendar getDepartmentCreated () { + return this.departmentCreated; + } + + @Override + public void setDepartmentCreated (final Calendar departmentCreated) { + this.departmentCreated = departmentCreated; + } + @Override public Long getDepartmentId () { return this.departmentId; @@ -175,16 +217,6 @@ public class CompanyDepartment implements Department, Comparable { this.departmentName = departmentName; } - @Override - public Calendar getDepartmentCreated () { - return this.departmentCreated; - } - - @Override - public void setDepartmentCreated (final Calendar departmentCreated) { - this.departmentCreated = departmentCreated; - } - @Override public User getDepartmentUserOwner () { return this.departmentUserOwner; @@ -195,35 +227,4 @@ public class CompanyDepartment implements Department, Comparable { this.departmentUserOwner = departmentUserOwner; } - @Override - public int compareTo (final Department department) { - 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 Department other = (Department) object; - - if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) { - return false; - } else if (!Objects.equals(this.getDepartmentName(), other.getDepartmentName())) { - return false; - } - - return true; - } - - @Override - public int hashCode () { - int hash = 5; - hash = 53 * hash + Objects.hashCode(this.getDepartmentCompany()); - hash = 53 * hash + Objects.hashCode(this.getDepartmentName()); - return hash; - } } diff --git a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java index 34e6fa5..cf730af 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java @@ -178,6 +178,15 @@ public class CompanyEmployee implements Employee, Comparable { return true; } + @Override + public int hashCode () { + int hash = 3; + hash = 97 * hash + Objects.hashCode(this.getEmployeeCompany()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeNumber()); + hash = 97 * hash + Objects.hashCode(this.getEmployeePersonalData()); + return hash; + } + @Override public BranchOffice getEmployeeBranchOffice () { return this.employeeBranchOffice; @@ -307,13 +316,4 @@ public class CompanyEmployee implements Employee, Comparable { public void setEmployeeUserOwner (final User employeeUserOwner) { this.employeeUserOwner = employeeUserOwner; } - - @Override - public int hashCode () { - int hash = 3; - hash = 97 * hash + Objects.hashCode(this.getEmployeeCompany()); - hash = 97 * hash + Objects.hashCode(this.getEmployeeNumber()); - hash = 97 * hash + Objects.hashCode(this.getEmployeePersonalData()); - return hash; - } } diff --git a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java index 9eddc11..18b07db 100644 --- a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java +++ b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java @@ -68,6 +68,14 @@ public class CompanyHeadQuartersData implements HeadQuartersData, Comparable { */ private static final long serialVersionUID = 18_427_587_187_609L; + /** + * Timestamp when this entry has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "job_position_created", nullable = false, updatable = false) + private Calendar jobPositionCreated; + /** * Id number */ @@ -57,32 +65,29 @@ public class EmployeePosition implements JobPosition, Comparable { @Column (name = "job_position_name", length = 10, nullable = false, unique = true) private String jobPositionName; - /** - * Timestamp when this entry has been created - */ - @Basic (optional = false) - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "job_position_created", nullable = false, updatable = false) - private Calendar jobPositionCreated; - @Override - public Long getJobPositionId () { - return this.jobPositionId; + public int compareTo (final JobPosition jobPosition) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override - public void setJobPositionId (final Long jobPositionId) { - this.jobPositionId = jobPositionId; - } + public boolean equals (final Object object) { + if (object == null) { + return false; + } else if (this.getClass() != object.getClass()) { + return false; + } - @Override - public String getJobPositionName () { - return this.jobPositionName; + final JobPosition other = (JobPosition) object; + + return Objects.equals(this.getJobPositionName(), other.getJobPositionName()); } @Override - public void setJobPositionName (final String jobPositionName) { - this.jobPositionName = jobPositionName; + public int hashCode () { + int hash = 7; + hash = 37 * hash + Objects.hashCode(this.getJobPositionName()); + return hash; } @Override @@ -96,28 +101,23 @@ public class EmployeePosition implements JobPosition, Comparable { } @Override - public int compareTo (final JobPosition jobPosition) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + public Long getJobPositionId () { + return this.jobPositionId; } @Override - public boolean equals (final Object object) { - if (object == null) { - return false; - } else if (getClass() != object.getClass()) { - return false; - } - - final JobPosition other = (JobPosition) object; + public void setJobPositionId (final Long jobPositionId) { + this.jobPositionId = jobPositionId; + } - return Objects.equals(this.getJobPositionName(), other.getJobPositionName()); + @Override + public String getJobPositionName () { + return this.jobPositionName; } @Override - public int hashCode () { - int hash = 7; - hash = 37 * hash + Objects.hashCode(this.getJobPositionName()); - return hash; + public void setJobPositionName (final String jobPositionName) { + this.jobPositionName = jobPositionName; } } diff --git a/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java b/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java index c2cd725..4175369 100644 --- a/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java +++ b/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java @@ -47,6 +47,14 @@ public class CompanyLogo implements BusinessLogo, Comparable { */ private static final long serialVersionUID = 475_871_875_718_751_285L; + /** + * Timestamp when this entry has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "logo_entry_created", nullable = false, updatable = false) + private Calendar logoCreated; + /** * Local file name of the logo (relative to /resources/logos/) */ @@ -69,32 +77,29 @@ public class CompanyLogo implements BusinessLogo, Comparable { @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false) private User logoUploader; - /** - * Timestamp when this entry has been created - */ - @Basic (optional = false) - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "logo_entry_created", nullable = false, updatable = false) - private Calendar logoCreated; - @Override - public String getLogoFileName () { - return this.logoFileName; + public int compareTo (final BusinessLogo businessLogo) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override - public void setLogoFileName (final String logoFileName) { - this.logoFileName = logoFileName; - } + public boolean equals (final Object object) { + if (object == null) { + return false; + } else if (this.getClass() != object.getClass()) { + return false; + } - @Override - public Long getLogoId () { - return this.logoId; + final BusinessLogo other = (BusinessLogo) object; + + return Objects.equals(this.getLogoFileName(), other.getLogoFileName()); } @Override - public void setLogoId (final Long logoId) { - this.logoId = logoId; + public int hashCode () { + int hash = 3; + hash = 53 * hash + Objects.hashCode(this.getLogoFileName()); + return hash; } @Override @@ -108,37 +113,33 @@ public class CompanyLogo implements BusinessLogo, Comparable { } @Override - public User getLogoUploader () { - return this.logoUploader; + public String getLogoFileName () { + return this.logoFileName; } @Override - public void setLogoUploader (final User logoUploader) { - this.logoUploader = logoUploader; + public void setLogoFileName (final String logoFileName) { + this.logoFileName = logoFileName; } @Override - public int compareTo (final BusinessLogo businessLogo) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + public Long getLogoId () { + return this.logoId; } @Override - public boolean equals (final Object object) { - if (object == null) { - return false; - } else if (getClass() != object.getClass()) { - return false; - } - - final BusinessLogo other = (BusinessLogo) object; + public void setLogoId (final Long logoId) { + this.logoId = logoId; + } - return Objects.equals(this.getLogoFileName(), other.getLogoFileName()); + @Override + public User getLogoUploader () { + return this.logoUploader; } @Override - public int hashCode () { - int hash = 3; - hash = 53 * hash + Objects.hashCode(this.getLogoFileName()); - return hash; + public void setLogoUploader (final User logoUploader) { + this.logoUploader = logoUploader; } + }