]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 16 Apr 2020 17:27:42 +0000 (19:27 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 16 Apr 2020 17:27:42 +0000 (19:27 +0200)
- renamed branchCreated to branchEntryCreated
- added branchEntryUpdated

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java
src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java

index fb0b07aa9096317ba1bc521387385d76ffe79dc3..4795de994c1506f5d41a2401a1c3215aca2c0f49 100644 (file)
@@ -305,18 +305,33 @@ public interface BranchOffice extends Comparable<BranchOffice>, Serializable {
         * <p>
         * @return Timestamp when this entry has been created
         */
-       Date getBranchCreated ();
+       Date getBranchEntryCreated ();
 
        /**
         * Setter for timestamp when this entry has been created
         * <p>
         * @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
+        * <p>
+        * @return Timestamp when this entry has been updated
+        */
+       Date getBranchEntryUpdated ();
+
+       /**
+        * Setter for timestamp when this entry has been updated
+        * <p>
+        * @param branchUpdated Timestamp when this entry has been updated
+        */
+       void setBranchEntryUpdated (final Date branchUpdated);
 
        @Override
        boolean equals (final Object object);
 
        @Override
        int hashCode ();
+
 }
index 1450e6b4a192fd083f14c61f22250bf21d75283e..e175dbec8d2c712ac187348d99f743f4ff57eb06 100644 (file)
@@ -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());