From 0f27cdd8561f1a98b44d13ef10868a4dff91737f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 26 Apr 2020 19:15:41 +0200 Subject: [PATCH] Continued: - need to compare all entity properties in equals()/hashCode() - renamed some fields from fooCreated to fooEntryCreated - added some missing fooEntryUpdated fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/basicdata/BusinessBasicData.java | 40 +++++++- .../branchoffice/BusinessBranchOffice.java | 27 ++++- .../model/department/BusinessDepartment.java | 33 +++++-- .../model/department/Department.java | 20 +++- .../model/employee/BusinessEmployee.java | 33 +++++-- .../headquarter/BusinessHeadquarter.java | 74 +++++++++++--- .../model/headquarter/Headquarter.java | 20 +++- .../model/jobposition/EmployeePosition.java | 99 ++++++++++--------- .../jobposition/HireableJobPosition.java | 24 ++--- .../model/logo/BusinessLogo.java | 31 ++++-- .../jcontactsbusiness/model/logo/Logo.java | 20 +++- .../opening_time/BusinessOpeningTime.java | 6 +- 12 files changed, 319 insertions(+), 108 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java b/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java index f7d26e5..bad14b2 100644 --- a/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java +++ b/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java @@ -263,10 +263,34 @@ public class BusinessBasicData implements BasicData { if (!Objects.equals(this.getBasicDataId(), other.getBasicDataId())) { return false; - } else if (!Objects.equals(this.getCompanyShortName(), other.getCompanyShortName())) { + } else if (!Objects.equals(this.getCompanyComments(), other.getCompanyComments())) { + return false; + } else if (!Objects.equals(this.getCompanyContactEmployee(), other.getCompanyContactEmployee())) { + return false; + } else if (!Objects.equals(this.getCompanyEmailAddress(), other.getCompanyEmailAddress())) { + return false; + } else if (!Objects.equals(this.getCompanyFaxNumber(), other.getCompanyFaxNumber())) { + return false; + } else if (!Objects.equals(this.getCompanyFounder(), other.getCompanyFounder())) { + return false; + } else if (!Objects.equals(this.getCompanyHeadquarterData(), other.getCompanyHeadquarterData())) { + return false; + } else if (!Objects.equals(this.getCompanyLandLineNumber(), other.getCompanyLandLineNumber())) { + return false; + } else if (!Objects.equals(this.getCompanyLogo(), other.getCompanyLogo())) { return false; } else if (!Objects.equals(this.getCompanyName(), other.getCompanyName())) { return false; + } else if (!Objects.equals(this.getCompanyRoadNumber(), other.getCompanyRoadNumber())) { + return false; + } else if (!Objects.equals(this.getCompanyShortName(), other.getCompanyShortName())) { + return false; + } else if (!Objects.equals(this.getCompanyTaxNumber(), other.getCompanyTaxNumber())) { + return false; + } else if (!Objects.equals(this.getCompanyUserOwner(), other.getCompanyUserOwner())) { + return false; + } else if (!Objects.equals(this.getCompanyWebsiteUrl(), other.getCompanyWebsiteUrl())) { + return false; } return true; @@ -463,8 +487,20 @@ public class BusinessBasicData implements BasicData { int hash = 3; hash = 37 * hash + Objects.hashCode(this.getBasicDataId()); - hash = 37 * hash + Objects.hashCode(this.getCompanyShortName()); + hash = 37 * hash + Objects.hashCode(this.getCompanyComments()); + hash = 37 * hash + Objects.hashCode(this.getCompanyContactEmployee()); + hash = 37 * hash + Objects.hashCode(this.getCompanyEmailAddress()); + hash = 37 * hash + Objects.hashCode(this.getCompanyFaxNumber()); + hash = 37 * hash + Objects.hashCode(this.getCompanyFounder()); + hash = 37 * hash + Objects.hashCode(this.getCompanyHeadquarterData()); + hash = 37 * hash + Objects.hashCode(this.getCompanyLandLineNumber()); + hash = 37 * hash + Objects.hashCode(this.getCompanyLogo()); hash = 37 * hash + Objects.hashCode(this.getCompanyName()); + hash = 37 * hash + Objects.hashCode(this.getCompanyRoadNumber()); + hash = 37 * hash + Objects.hashCode(this.getCompanyShortName()); + hash = 37 * hash + Objects.hashCode(this.getCompanyTaxNumber()); + hash = 37 * hash + Objects.hashCode(this.getCompanyUserOwner()); + hash = 37 * hash + Objects.hashCode(this.getCompanyWebsiteUrl()); return hash; } diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java index e175dbe..32ee4c9 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java @@ -369,22 +369,38 @@ public class BusinessBranchOffice implements BranchOffice { if (!Objects.equals(this.getBranchCity(), branchOffice.getBranchCity())) { 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())) { + return false; } else if (!Objects.equals(this.getBranchHouseNumber(), branchOffice.getBranchHouseNumber())) { return false; } else if (!Objects.equals(this.getBranchHouseNumberExtension(), branchOffice.getBranchHouseNumberExtension())) { return false; + } else if (!Objects.equals(this.getBranchId(), branchOffice.getBranchId())) { + return false; + } else if (!Objects.equals(this.getBranchLandLineNumber(), branchOffice.getBranchLandLineNumber())) { + return false; } else if (!Objects.equals(this.getBranchLastHouseNumber(), branchOffice.getBranchLastHouseNumber())) { return false; } else if (!Objects.equals(this.getBranchNumber(), branchOffice.getBranchNumber())) { return false; + } else if (!Objects.equals(this.getBranchOpeningTimes(), branchOffice.getBranchOpeningTimes())) { + 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())) { return false; } else if (!Objects.equals(this.getBranchSuiteNumber(), branchOffice.getBranchSuiteNumber())) { return false; + } else if (!Objects.equals(this.getBranchUserOwner(), branchOffice.getBranchUserOwner())) { + return false; } else if (!Objects.equals(this.getBranchZipCode(), branchOffice.getBranchZipCode())) { return false; } @@ -613,14 +629,23 @@ public class BusinessBranchOffice implements BranchOffice { int hash = 7; 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.getBranchNumber()); + hash = 53 * hash + Objects.hashCode(this.getBranchEmailAddress()); + hash = 53 * hash + Objects.hashCode(this.getBranchFaxNumber()); hash = 53 * hash + Objects.hashCode(this.getBranchHouseNumber()); hash = 53 * hash + Objects.hashCode(this.getBranchHouseNumberExtension()); + hash = 53 * hash + Objects.hashCode(this.getBranchId()); + 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.getBranchOpeningTimes()); + 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()); + hash = 53 * hash + Objects.hashCode(this.getBranchUserOwner()); hash = 53 * hash + Objects.hashCode(this.getBranchZipCode()); return hash; diff --git a/src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java b/src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java index f8e0dc5..7c90924 100644 --- a/src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java +++ b/src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java @@ -88,8 +88,15 @@ public class BusinessDepartment implements Department { */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) - @Column (name = "department_created", nullable = false, updatable = false) - private Date departmentCreated; + @Column (name = "department_entry_created", updatable = false, nullable = false) + private Date departmentEntryCreated; + + /** + * Timestamp when this entry has been updated + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "department_entry_updated", insertable = false, nullable = false) + private Date departmentEntryUpdated; /** * Where this department is located @@ -200,7 +207,7 @@ public class BusinessDepartment implements Department { final Department other = (Department) object; - if (!Objects.equals(this.getDepartmentId(), other.getDepartmentId())) { + if (!Objects.equals(this.getDepartmentBranchOffice(), other.getDepartmentBranchOffice())) { return false; } else if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) { return false; @@ -233,14 +240,26 @@ public class BusinessDepartment implements Department { @Override @SuppressWarnings ("ReturnOfDateField") - public Date getDepartmentCreated () { - return this.departmentCreated; + public Date getDepartmentEntryCreated () { + return this.departmentEntryCreated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setDepartmentEntryCreated (final Date departmentEntryCreated) { + this.departmentEntryCreated = departmentEntryCreated; + } + + @Override + @SuppressWarnings ("ReturnOfDateField") + public Date getDepartmentEntryUpdated () { + return this.departmentEntryUpdated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setDepartmentCreated (final Date departmentCreated) { - this.departmentCreated = departmentCreated; + public void setDepartmentEntryUpdated (Date departmentEntryUpdated) { + this.departmentEntryUpdated = departmentEntryUpdated; } @Override diff --git a/src/org/mxchange/jcontactsbusiness/model/department/Department.java b/src/org/mxchange/jcontactsbusiness/model/department/Department.java index 6c44c35..dcfa260 100644 --- a/src/org/mxchange/jcontactsbusiness/model/department/Department.java +++ b/src/org/mxchange/jcontactsbusiness/model/department/Department.java @@ -134,14 +134,28 @@ public interface Department extends Comparable, Serializable { *

* @return Timestamp when this entry has been created */ - Date getDepartmentCreated (); + Date getDepartmentEntryCreated (); /** * Setter for timestamp when this entry has been created *

- * @param departmentCreated Timestamp when this entry has been created + * @param departmentEntryCreated Timestamp when this entry has been created */ - void setDepartmentCreated (final Date departmentCreated); + void setDepartmentEntryCreated (final Date departmentEntryCreated); + + /** + * Getter for timestamp when this entry has been updated + *

+ * @return Timestamp when this entry has been updated + */ + Date getDepartmentEntryUpdated (); + + /** + * Setter for timestamp when this entry has been updated + *

+ * @param departmentEntryUpdated Timestamp when this entry has been updated + */ + void setDepartmentEntryUpdated (final Date departmentEntryUpdated); @Override boolean equals (final Object object); diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java b/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java index 59e1c12..38386dd 100644 --- a/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java @@ -220,9 +220,6 @@ public class BusinessEmployee implements Employable { // Init comparisons final int[] comparators = { - // First employee's number - // First employee's number - // First employee's number // First employee's number StringUtils.compareIgnoreCase(this.getEmployeeNumber(), employable.getEmployeeNumber()), // ... finally contact data @@ -256,14 +253,30 @@ public class BusinessEmployee implements Employable { final Employable employee = (Employable) object; - if (!Objects.equals(this.getEmployeeId(), employee.getEmployeeId())) { + if (!Objects.equals(this.getEmployeeBasicData(), employee.getEmployeeBasicData())) { + return false; + } else if (!Objects.equals(this.getEmployeeBranchOffice(), employee.getEmployeeBranchOffice())) { + return false; + } else if (!Objects.equals(this.getEmployeeDepartment(), employee.getEmployeeDepartment())) { + return false; + } else if (!Objects.equals(this.getEmployeeEmailAddress(), employee.getEmployeeEmailAddress())) { + return false; + } else if (!Objects.equals(this.getEmployeeHeadquarter(), employee.getEmployeeHeadquarter())) { return false; - } else if (!Objects.equals(this.getEmployeeBasicData(), employee.getEmployeeBasicData())) { + } else if (!Objects.equals(this.getEmployeeId(), employee.getEmployeeId())) { + return false; + } else if (!Objects.equals(this.getEmployeeJobPosition(), employee.getEmployeeJobPosition())) { + return false; + } else if (!Objects.equals(this.getEmployeeMobileNumber(), employee.getEmployeeMobileNumber())) { return false; } else if (!Objects.equals(this.getEmployeeNumber(), employee.getEmployeeNumber())) { return false; } else if (!Objects.equals(this.getEmployeePersonalData(), employee.getEmployeePersonalData())) { return false; + } else if (!Objects.equals(this.getEmployeePhoneExtension(), employee.getEmployeePhoneExtension())) { + return false; + } else if (!Objects.equals(this.getEmployeeUserOwner(), employee.getEmployeeUserOwner())) { + return false; } return true; @@ -417,10 +430,18 @@ public class BusinessEmployee implements Employable { public int hashCode () { int hash = 3; - hash = 97 * hash + Objects.hashCode(this.getEmployeeId()); hash = 97 * hash + Objects.hashCode(this.getEmployeeBasicData()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeBranchOffice()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeDepartment()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeEmailAddress()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeHeadquarter()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeId()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeJobPosition()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeMobileNumber()); hash = 97 * hash + Objects.hashCode(this.getEmployeeNumber()); hash = 97 * hash + Objects.hashCode(this.getEmployeePersonalData()); + hash = 97 * hash + Objects.hashCode(this.getEmployeePhoneExtension()); + hash = 97 * hash + Objects.hashCode(this.getEmployeeUserOwner()); return hash; } diff --git a/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java b/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java index 738d0d6..f26e0af 100644 --- a/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java +++ b/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java @@ -102,19 +102,27 @@ public class BusinessHeadquarter implements Headquarter { @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false) private Country headquarterCountry; + /** + * Email address of headquarter + */ + @Column (name = "headquarter_email_address") + private String headquarterEmailAddress; + /** * Timestamp when this entry has been created */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) - @Column (name = "headquarter_entry_created", nullable = false, updatable = false) - private Date headquarterCreated; + @Column (name = "headquarter_entry_created", updatable = false, nullable = false) + private Date headquarterEntryCreated; /** - * Email address of headquarter + * Timestamp when this entry has been updated */ - @Column (name = "headquarter_email_address") - private String headquarterEmailAddress; + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "headquarter_entry_updated", insertable = false, nullable = false) + private Date headquarterEntryUpdated; /** * Headquarter' fax number @@ -334,22 +342,36 @@ public class BusinessHeadquarter implements Headquarter { final Headquarter headquarter = (Headquarter) object; - if (!Objects.equals(this.getHeadquarterId(), headquarter.getHeadquarterId())) { + if (!Objects.equals(this.getHeadquarterCity(), headquarter.getHeadquarterCity())) { + return false; + } else if (!Objects.equals(this.getHeadquarterCompanyName(), headquarter.getHeadquarterCompanyName())) { return false; - } else if (!Objects.equals(this.getHeadquarterCity(), headquarter.getHeadquarterCity())) { + } else if (!Objects.equals(this.getHeadquarterContactEmployee(), headquarter.getHeadquarterContactEmployee())) { return false; } else if (!Objects.equals(this.getHeadquarterCountry(), headquarter.getHeadquarterCountry())) { return false; + } else if (!Objects.equals(this.getHeadquarterEmailAddress(), headquarter.getHeadquarterEmailAddress())) { + return false; + } else if (!Objects.equals(this.getHeadquarterFaxNumber(), headquarter.getHeadquarterFaxNumber())) { + return false; } else if (!Objects.equals(this.getHeadquarterHouseNumber(), headquarter.getHeadquarterHouseNumber())) { return false; + } else if (!Objects.equals(this.getHeadquarterId(), headquarter.getHeadquarterId())) { + return false; + } else if (!Objects.equals(this.getHeadquarterLandLineNumber(), headquarter.getHeadquarterLandLineNumber())) { + return false; } else if (!Objects.equals(this.getHeadquarterLastHouseNumber(), headquarter.getHeadquarterLastHouseNumber())) { return false; + } else if (!Objects.equals(this.getHeadquarterOpeningTimes(), headquarter.getHeadquarterOpeningTimes())) { + return false; } else if (!Objects.equals(this.getHeadquarterStore(), headquarter.getHeadquarterStore())) { return false; } else if (!Objects.equals(this.getHeadquarterStreet(), headquarter.getHeadquarterStreet())) { return false; } else if (!Objects.equals(this.getHeadquarterSuiteNumber(), headquarter.getHeadquarterSuiteNumber())) { return false; + } else if (!Objects.equals(this.getHeadquarterUserOwner(), headquarter.getHeadquarterUserOwner())) { + return false; } else if (!Objects.equals(this.getHeadquarterZipCode(), headquarter.getHeadquarterZipCode())) { return false; } @@ -397,26 +419,38 @@ public class BusinessHeadquarter implements Headquarter { this.headquarterCountry = headquarterCountry; } + @Override + public String getHeadquarterEmailAddress () { + return this.headquarterEmailAddress; + } + + @Override + public void setHeadquarterEmailAddress (final String headquarterEmailAddress) { + this.headquarterEmailAddress = headquarterEmailAddress; + } + @Override @SuppressWarnings ("ReturnOfDateField") - public Date getHeadquarterCreated () { - return this.headquarterCreated; + public Date getHeadquarterEntryCreated () { + return this.headquarterEntryCreated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setHeadquarterCreated (final Date headquarterCreated) { - this.headquarterCreated = headquarterCreated; + public void setHeadquarterEntryCreated (final Date headquarterEntryCreated) { + this.headquarterEntryCreated = headquarterEntryCreated; } @Override - public String getHeadquarterEmailAddress () { - return this.headquarterEmailAddress; + @SuppressWarnings ("ReturnOfDateField") + public Date getHeadquarterEntryUpdated () { + return this.headquarterEntryUpdated; } @Override - public void setHeadquarterEmailAddress (final String headquarterEmailAddress) { - this.headquarterEmailAddress = headquarterEmailAddress; + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setHeadquarterEntryUpdated (final Date headquarterEntryUpdated) { + this.headquarterEntryUpdated = headquarterEntryUpdated; } @Override @@ -545,14 +579,22 @@ public class BusinessHeadquarter implements Headquarter { public int hashCode () { int hash = 7; - hash = 47 * hash + Objects.hashCode(this.getHeadquarterId()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterCity()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterCompanyName()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterContactEmployee()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterCountry()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterEmailAddress()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterFaxNumber()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterHouseNumber()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterHouseNumberExtension()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterId()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterLandLineNumber()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterLastHouseNumber()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterOpeningTimes()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterStore()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterStreet()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterSuiteNumber()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterUserOwner()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterZipCode()); return hash; diff --git a/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java b/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java index f938fa8..c9eff4e 100644 --- a/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java +++ b/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java @@ -276,14 +276,28 @@ public interface Headquarter extends Comparable, Serializable { *

* @return Timestamp when this entry has been created */ - Date getHeadquarterCreated (); + Date getHeadquarterEntryCreated (); /** * Setter for timestamp when this entry has been created *

- * @param headquarterCreated Timestamp when this entry has been created + * @param headquarterEntryCreated Timestamp when this entry has been created */ - void setHeadquarterCreated (final Date headquarterCreated); + void setHeadquarterEntryCreated (final Date headquarterEntryCreated); + + /** + * Getter for timestamp when this entry has been updated + *

+ * @return Timestamp when this entry has been updated + */ + Date getHeadquarterEntryUpdated (); + + /** + * Setter for timestamp when this entry has been updated + *

+ * @param headquarterEntryUpdated Timestamp when this entry has been updated + */ + void setHeadquarterEntryUpdated (final Date headquarterEntryUpdated); @Override boolean equals (final Object object); diff --git a/src/org/mxchange/jcontactsbusiness/model/jobposition/EmployeePosition.java b/src/org/mxchange/jcontactsbusiness/model/jobposition/EmployeePosition.java index 12420a4..88de0ce 100644 --- a/src/org/mxchange/jcontactsbusiness/model/jobposition/EmployeePosition.java +++ b/src/org/mxchange/jcontactsbusiness/model/jobposition/EmployeePosition.java @@ -68,22 +68,29 @@ public class EmployeePosition implements HireableJobPosition { */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) - @Column (name = "job_position_created", nullable = false, updatable = false) - private Date jobPositionCreated; + @Column (name = "job_position_entry_created", nullable = false, updatable = false) + private Date jobPositionEntryCreated; /** * When this job position (offer) was deleted */ - @Column (name = "job_position_deleted") + @Column (name = "job_position_entry_deleted") @Temporal (TemporalType.TIMESTAMP) - private Date jobPositionDeleted; + private Date jobPositionEntryDeleted; /** * When this job position (offer) has expired */ - @Column (name = "job_position_expired") + @Column (name = "job_position_entry_expired") @Temporal (TemporalType.TIMESTAMP) - private Date jobPositionExpired; + private Date jobPositionEntryExpired; + + /** + * Timestamp when this entry has been created + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "job_position_entry_updated", insertable = false) + private Date jobPositionEntryUpdated; /** * When a new employed was hired for this job position @@ -123,13 +130,6 @@ public class EmployeePosition implements HireableJobPosition { @Enumerated (EnumType.STRING) private JobPositionStatus jobPositionStatus; - /** - * Timestamp when this entry has been created - */ - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "job_position_updated", insertable = false) - private Date jobPositionUpdated; - @Override public int compareTo (final HireableJobPosition jobPosition) { // Check parameter on null-reference and equality to this @@ -168,11 +168,13 @@ public class EmployeePosition implements HireableJobPosition { final HireableJobPosition other = (HireableJobPosition) object; - if (!Objects.equals(this.getJobPositionId(), other.getJobPositionId())) { + if (!Objects.equals(this.getJobPositionAddedUser(), other.getJobPositionAddedUser())) { + return false; + } else if (!Objects.equals(this.getJobPositionId(), other.getJobPositionId())) { return false; } else if (!Objects.equals(this.getJobPositionName(), other.getJobPositionName())) { return false; - } else if (!Objects.equals(this.getJobPositionAddedUser(), other.getJobPositionAddedUser())) { + } else if (!Objects.equals(this.getJobPositionStatus(), other.getJobPositionStatus())) { return false; } @@ -191,82 +193,82 @@ public class EmployeePosition implements HireableJobPosition { @Override @SuppressWarnings ("ReturnOfDateField") - public Date getJobPositionCreated () { - return this.jobPositionCreated; + public Date getJobPositionEntryCreated () { + return this.jobPositionEntryCreated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setJobPositionCreated (final Date jobPositionCreated) { - this.jobPositionCreated = jobPositionCreated; + public void setJobPositionEntryCreated (final Date jobPositionEntryCreated) { + this.jobPositionEntryCreated = jobPositionEntryCreated; } @Override - public Long getJobPositionId () { - return this.jobPositionId; + @SuppressWarnings ("ReturnOfDateField") + public Date getJobPositionEntryDeleted () { + return this.jobPositionEntryDeleted; } @Override - public void setJobPositionId (final Long jobPositionId) { - this.jobPositionId = jobPositionId; + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setJobPositionEntryDeleted (final Date jobPositionEntryDeleted) { + this.jobPositionEntryDeleted = jobPositionEntryDeleted; } @Override - public String getJobPositionName () { - return this.jobPositionName; + @SuppressWarnings ("ReturnOfDateField") + public Date getJobPositionEntryExpired () { + return this.jobPositionEntryExpired; } @Override - public void setJobPositionName (final String jobPositionName) { - this.jobPositionName = jobPositionName; + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setJobPositionEntryExpired (final Date jobPositionEntryExpired) { + this.jobPositionEntryExpired = jobPositionEntryExpired; } @Override @SuppressWarnings ("ReturnOfDateField") - public Date getJobPositionUpdated () { - return this.jobPositionUpdated; + public Date getJobPositionEntryUpdated () { + return this.jobPositionEntryUpdated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setJobPositionUpdated (final Date jobPositionUpdated) { - this.jobPositionUpdated = jobPositionUpdated; + public void setJobPositionEntryUpdated (final Date jobPositionEntryUpdated) { + this.jobPositionEntryUpdated = jobPositionEntryUpdated; } @Override @SuppressWarnings ("ReturnOfDateField") - public Date getJobPositionDeleted () { - return this.jobPositionDeleted; + public Date getJobPositionHired () { + return this.jobPositionHired; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setJobPositionDeleted (final Date jobPositionDeleted) { - this.jobPositionDeleted = jobPositionDeleted; + public void setJobPositionHired (final Date jobPositionHired) { + this.jobPositionHired = jobPositionHired; } @Override - @SuppressWarnings ("ReturnOfDateField") - public Date getJobPositionExpired () { - return this.jobPositionExpired; + public Long getJobPositionId () { + return this.jobPositionId; } @Override - @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setJobPositionExpired (final Date jobPositionExpired) { - this.jobPositionExpired = jobPositionExpired; + public void setJobPositionId (final Long jobPositionId) { + this.jobPositionId = jobPositionId; } @Override - @SuppressWarnings ("ReturnOfDateField") - public Date getJobPositionHired () { - return this.jobPositionHired; + public String getJobPositionName () { + return this.jobPositionName; } @Override - @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setJobPositionHired (final Date jobPositionHired) { - this.jobPositionHired = jobPositionHired; + public void setJobPositionName (final String jobPositionName) { + this.jobPositionName = jobPositionName; } @Override @@ -295,9 +297,10 @@ public class EmployeePosition implements HireableJobPosition { public int hashCode () { int hash = 7; + hash = 37 * hash + Objects.hashCode(this.getJobPositionAddedUser()); hash = 37 * hash + Objects.hashCode(this.getJobPositionId()); hash = 37 * hash + Objects.hashCode(this.getJobPositionName()); - hash = 37 * hash + Objects.hashCode(this.getJobPositionAddedUser()); + hash = 37 * hash + Objects.hashCode(this.getJobPositionStatus()); return hash; } diff --git a/src/org/mxchange/jcontactsbusiness/model/jobposition/HireableJobPosition.java b/src/org/mxchange/jcontactsbusiness/model/jobposition/HireableJobPosition.java index 1346cb3..d6b36e0 100644 --- a/src/org/mxchange/jcontactsbusiness/model/jobposition/HireableJobPosition.java +++ b/src/org/mxchange/jcontactsbusiness/model/jobposition/HireableJobPosition.java @@ -61,28 +61,28 @@ public interface HireableJobPosition extends Comparable, Se *

* @return Timestamp when this entry has been created */ - Date getJobPositionCreated (); + Date getJobPositionEntryCreated (); /** * Setter for timestamp when this entry has been created *

- * @param jobPositionCreated Timestamp when this entry has been created + * @param jobPositionEntryCreated Timestamp when this entry has been created */ - void setJobPositionCreated (final Date jobPositionCreated); + void setJobPositionEntryCreated (final Date jobPositionEntryCreated); /** * Getter for timestamp when this entry has been updated *

* @return Timestamp when this entry has been updated */ - Date getJobPositionUpdated (); + Date getJobPositionEntryUpdated (); /** * Setter for timestamp when this entry has been updated *

- * @param jobPositionUpdated Timestamp when this entry has been updated + * @param jobPositionEntryUpdated Timestamp when this entry has been updated */ - void setJobPositionUpdated (final Date jobPositionUpdated); + void setJobPositionEntryUpdated (final Date jobPositionEntryUpdated); /** * Getter for job position start @@ -117,28 +117,28 @@ public interface HireableJobPosition extends Comparable, Se *

* @return When this job position was deleted by user */ - Date getJobPositionDeleted (); + Date getJobPositionEntryDeleted (); /** * Setter for when this job position was deleted by user *

- * @param jobPositionDeleted When this job position was deleted by user + * @param jobPositionEntryDeleted When this job position was deleted by user */ - void setJobPositionDeleted (final Date jobPositionDeleted); + void setJobPositionEntryDeleted (final Date jobPositionEntryDeleted); /** * Getter for when this job position has expired *

* @return When this job position has expired */ - Date getJobPositionExpired (); + Date getJobPositionEntryExpired (); /** * Setter for when this job position has expired *

- * @param jobPositionExpired When this job position has expired + * @param jobPositionEntryExpired When this job position has expired */ - void setJobPositionExpired (final Date jobPositionExpired); + void setJobPositionEntryExpired (final Date jobPositionEntryExpired); /** * Getter for when employee was hired for this job position diff --git a/src/org/mxchange/jcontactsbusiness/model/logo/BusinessLogo.java b/src/org/mxchange/jcontactsbusiness/model/logo/BusinessLogo.java index fd505a3..f35910f 100644 --- a/src/org/mxchange/jcontactsbusiness/model/logo/BusinessLogo.java +++ b/src/org/mxchange/jcontactsbusiness/model/logo/BusinessLogo.java @@ -56,8 +56,15 @@ public class BusinessLogo implements Logo { */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) - @Column (name = "logo_entry_created", nullable = false, updatable = false) - private Date logoCreated; + @Column (name = "logo_entry_created", updatable = false, nullable = false) + private Date logoEntryCreated; + + /** + * Timestamp when this entry has been created + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "logo_entry_updated", insertable = false, nullable = false) + private Date logoEntryUpdated; /** * Local file name of the logo (relative to /resources/logos/) @@ -130,14 +137,26 @@ public class BusinessLogo implements Logo { @Override @SuppressWarnings ("ReturnOfDateField") - public Date getLogoCreated () { - return this.logoCreated; + public Date getLogoEntryCreated () { + return this.logoEntryCreated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setLogoEntryCreated (final Date logoEntryCreated) { + this.logoEntryCreated = logoEntryCreated; + } + + @Override + @SuppressWarnings ("ReturnOfDateField") + public Date getLogoEntryUpdated () { + return this.logoEntryUpdated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setLogoCreated (final Date logoCreated) { - this.logoCreated = logoCreated; + public void setLogoEntryUpdated (final Date logoEntryUpdated) { + this.logoEntryUpdated = logoEntryUpdated; } @Override diff --git a/src/org/mxchange/jcontactsbusiness/model/logo/Logo.java b/src/org/mxchange/jcontactsbusiness/model/logo/Logo.java index 884926a..ddfc9e3 100644 --- a/src/org/mxchange/jcontactsbusiness/model/logo/Logo.java +++ b/src/org/mxchange/jcontactsbusiness/model/logo/Logo.java @@ -74,14 +74,28 @@ public interface Logo extends Comparable, Serializable { *

* @return Timestamp when this entry has been created */ - Date getLogoCreated (); + Date getLogoEntryCreated (); /** * Setter for timestamp when this entry has been created *

- * @param logoCreated Timestamp when this entry has been created + * @param logoEntryCreated Timestamp when this entry has been created */ - void setLogoCreated (final Date logoCreated); + void setLogoEntryCreated (final Date logoEntryCreated); + + /** + * Getter for timestamp when this entry has been updated + *

+ * @return Timestamp when this entry has been updated + */ + Date getLogoEntryUpdated (); + + /** + * Setter for timestamp when this entry has been updated + *

+ * @param logoEntryUpdated Timestamp when this entry has been updated + */ + void setLogoEntryUpdated (final Date logoEntryUpdated); @Override boolean equals (final Object object); diff --git a/src/org/mxchange/jcontactsbusiness/model/opening_time/BusinessOpeningTime.java b/src/org/mxchange/jcontactsbusiness/model/opening_time/BusinessOpeningTime.java index 8cd9b13..258f41e 100644 --- a/src/org/mxchange/jcontactsbusiness/model/opening_time/BusinessOpeningTime.java +++ b/src/org/mxchange/jcontactsbusiness/model/opening_time/BusinessOpeningTime.java @@ -168,7 +168,11 @@ public class BusinessOpeningTime implements OpeningTime { // First starting day of the week this.getOpeningStartDay().compareTo(openingTime.getOpeningStartDay()), // ... and end day of the week - this.getOpeningEndDay().compareTo(openingTime.getOpeningEndDay()) + this.getOpeningEndDay().compareTo(openingTime.getOpeningEndDay()), + // ... and start time of the week + this.getOpeningStartTime().compareTo(openingTime.getOpeningStartTime()), + // ... and end time of the week + this.getOpeningEndTime().compareTo(openingTime.getOpeningEndTime()) }; // Check all values -- 2.39.5