From f3a2111963e01c1db95928b1e61e95246a985784 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 16 Apr 2020 19:27:42 +0200 Subject: [PATCH] Continued: - renamed branchCreated to branchEntryCreated - added branchEntryUpdated MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/branchoffice/BranchOffice.java | 19 +++++++- .../branchoffice/BusinessBranchOffice.java | 48 ++++++++++++------- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java index fb0b07a..4795de9 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java @@ -305,18 +305,33 @@ public interface BranchOffice extends Comparable, Serializable { *

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

* @param branchCreated Timestamp when this entry has been created */ - void setBranchCreated (final Date branchCreated); + void setBranchEntryCreated (final Date branchCreated); + + /** + * Getter for timestamp when this entry has been updated + *

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

+ * @param branchUpdated Timestamp when this entry has been updated + */ + void setBranchEntryUpdated (final Date branchUpdated); @Override boolean equals (final Object object); @Override int hashCode (); + } diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java index 1450e6b..e175dbe 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java @@ -106,19 +106,26 @@ public class BusinessBranchOffice implements BranchOffice { @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false) private Country branchCountry; + /** + * Branch office's main email address (example: branch-name@company.com) + */ + @Column (name = "branch_email_address", length = 100) + private String branchEmailAddress; + /** * Timestamp when this entry has been created */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) @Column (name = "branch_entry_created", nullable = false, updatable = false) - private Date branchCreated; + private Date branchEntryCreated; /** - * Branch office's main email address (example: branch-name@company.com) + * Timestamp when this entry has been created */ - @Column (name = "branch_email_address", length = 100) - private String branchEmailAddress; + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "branch_entry_updated", insertable = false) + private Date branchEntryUpdated; /** * Branch office's main fax number: +ccxxxxxxxxxx @@ -360,9 +367,7 @@ public class BusinessBranchOffice implements BranchOffice { // @todo Maybe a bit unsafe cast? final BranchOffice branchOffice = (BranchOffice) object; - if (!Objects.equals(this.getBranchId(), branchOffice.getBranchId())) { - return false; - } else if (!Objects.equals(this.getBranchCity(), branchOffice.getBranchCity())) { + if (!Objects.equals(this.getBranchCity(), branchOffice.getBranchCity())) { return false; } else if (!Objects.equals(this.getBranchCountry(), branchOffice.getBranchCountry())) { return false; @@ -427,26 +432,38 @@ public class BusinessBranchOffice implements BranchOffice { this.branchCountry = branchCountry; } + @Override + public String getBranchEmailAddress () { + return this.branchEmailAddress; + } + + @Override + public void setBranchEmailAddress (final String branchEmailAddress) { + this.branchEmailAddress = branchEmailAddress; + } + @Override @SuppressWarnings ("ReturnOfDateField") - public Date getBranchCreated () { - return this.branchCreated; + public Date getBranchEntryCreated () { + return this.branchEntryCreated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setBranchCreated (final Date branchCreated) { - this.branchCreated = branchCreated; + public void setBranchEntryCreated (final Date branchEntryCreated) { + this.branchEntryCreated = branchEntryCreated; } @Override - public String getBranchEmailAddress () { - return this.branchEmailAddress; + @SuppressWarnings ("ReturnOfDateField") + public Date getBranchEntryUpdated () { + return this.branchEntryUpdated; } @Override - public void setBranchEmailAddress (final String branchEmailAddress) { - this.branchEmailAddress = branchEmailAddress; + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setBranchEntryUpdated (final Date branchEntryUpdated) { + this.branchEntryUpdated = branchEntryUpdated; } @Override @@ -595,7 +612,6 @@ public class BusinessBranchOffice implements BranchOffice { public int hashCode () { int hash = 7; - hash = 53 * hash + Objects.hashCode(this.getBranchId()); hash = 53 * hash + Objects.hashCode(this.getBranchCity()); hash = 53 * hash + Objects.hashCode(this.getBranchCountry()); hash = 53 * hash + Objects.hashCode(this.getBranchNumber()); -- 2.39.5