From 6e53588a498c64adb4b1eb1d80557400851e0274 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 16 Apr 2020 19:47:53 +0200 Subject: [PATCH] Continued: - renamed field employeeCreated to employeeEntryCreated - added field employeeEntryUpdated MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/employee/BusinessEmployee.java | 62 ++++++++++++------- .../model/employee/Employable.java | 18 +++++- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java b/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java index 467454c..59e1c12 100644 --- a/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java @@ -91,14 +91,6 @@ public class BusinessEmployee implements Employable { @OneToOne (targetEntity = BusinessBranchOffice.class, cascade = CascadeType.REFRESH) private BranchOffice employeeBranchOffice; - /** - * Timestamp when this entry has been created - */ - @Basic (optional = false) - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "employee_entry_created", nullable = false, updatable = false) - private Date employeeCreated; - /** * Department the employee works at */ @@ -112,6 +104,21 @@ public class BusinessEmployee implements Employable { @Column (name = "employee_email_address", length = 30) private String employeeEmailAddress; + /** + * Timestamp when this entry has been created + */ + @Basic (optional = false) + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "employee_entry_created", nullable = false, updatable = false) + private Date employeeEntryCreated; + + /** + * Timestamp when this entry has been created + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "employee_entry_updated", insertable = false) + private Date employeeEntryUpdated; + /** * Head quarters id number (if the employee works there) */ @@ -230,8 +237,7 @@ public class BusinessEmployee implements Employable { // ... branch office BranchOffices.compare(this.getEmployeeBranchOffice(), employable.getEmployeeBranchOffice()), // ... next headquarters - Headquarters.compare(this.getEmployeeHeadquarter(), employable.getEmployeeHeadquarter()), - }; + Headquarters.compare(this.getEmployeeHeadquarter(), employable.getEmployeeHeadquarter()),}; // Check all values final int comparison = Comparables.checkAll(comparators); @@ -283,18 +289,6 @@ public class BusinessEmployee implements Employable { this.employeeBranchOffice = employeeBranchOffice; } - @Override - @SuppressWarnings ("ReturnOfDateField") - public Date getEmployeeCreated () { - return this.employeeCreated; - } - - @Override - @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setEmployeeCreated (final Date employeeCreated) { - this.employeeCreated = employeeCreated; - } - @Override public Department getEmployeeDepartment () { return this.employeeDepartment; @@ -315,6 +309,30 @@ public class BusinessEmployee implements Employable { this.employeeEmailAddress = employeeEmailAddress; } + @Override + @SuppressWarnings ("ReturnOfDateField") + public Date getEmployeeEntryCreated () { + return this.employeeEntryCreated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setEmployeeEntryCreated (final Date employeeEntryCreated) { + this.employeeEntryCreated = employeeEntryCreated; + } + + @Override + @SuppressWarnings ("ReturnOfDateField") + public Date getEmployeeEntryUpdated () { + return this.employeeEntryUpdated; + } + + @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setEmployeeEntryUpdated (final Date employeeEntryUpdated) { + this.employeeEntryUpdated = employeeEntryUpdated; + } + @Override public Headquarter getEmployeeHeadquarter () { return this.employeeHeadquarter; diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/Employable.java b/src/org/mxchange/jcontactsbusiness/model/employee/Employable.java index 4d4d357..2e9f33c 100644 --- a/src/org/mxchange/jcontactsbusiness/model/employee/Employable.java +++ b/src/org/mxchange/jcontactsbusiness/model/employee/Employable.java @@ -207,14 +207,28 @@ public interface Employable extends Comparable, Serializable { *

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

* @param employeeCreated Timestamp when this entry has been created */ - void setEmployeeCreated (final Date employeeCreated); + void setEmployeeEntryCreated (final Date employeeCreated); + + /** + * Getter for timestamp when this entry has been updated + *

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

+ * @param employeeUpdated Timestamp when this entry has been updated + */ + void setEmployeeEntryUpdated (final Date employeeUpdated); @Override boolean equals (final Object object); -- 2.39.5