]> git.mxchange.org Git - jcustomer-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 26 Apr 2020 18:11:44 +0000 (20:11 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Apr 2020 18:11:44 +0000 (20:11 +0200)
- renamed customerCreated to customerEntryCreated
- renamed customerUpdated to customerEntryUpdated
- need to check all entity properties in equals()/hashCode() methods

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcustomercore/model/customer/ContactCustomer.java
src/org/mxchange/jcustomercore/model/customer/Customer.java

index 6b95a619d0b2eb46c443a32556159bbbf5a58f00..4372510d8c764893d447f6fd960bab0d6ae5b39c 100644 (file)
@@ -84,9 +84,16 @@ public class ContactCustomer implements Customer {
         * When this customer has been created
         */
        @Basic (optional = false)
-       @Column (name = "customer_created", nullable = false, updatable = false)
+       @Column (name = "customer_entry_created", updatable = false, nullable = false)
        @Temporal (TemporalType.TIMESTAMP)
-       private Date customerCreated;
+       private Date customerEntryCreated;
+
+       /**
+        * When this customer has been updated
+        */
+       @Column (name = "customer_entry_updated")
+       @Temporal (TemporalType.TIMESTAMP)
+       private Date customerEntryUpdated;
 
        /**
         * Id number for this entry
@@ -117,13 +124,6 @@ public class ContactCustomer implements Customer {
        @Column (name = "customer_number", nullable = false, updatable = false, unique = true)
        private String customerNumber;
 
-       /**
-        * When this customer has been updated
-        */
-       @Column (name = "customer_updated")
-       @Temporal (TemporalType.TIMESTAMP)
-       private Date customerUpdated;
-
        /**
         * Default constructor
         */
@@ -203,12 +203,22 @@ public class ContactCustomer implements Customer {
 
                final Customer other = (Customer) object;
 
-               if (!Objects.equals(this.getCustomerNumber(), other.getCustomerNumber())) {
+               if (!Objects.equals(this.getCustomerAccountStatus(), other.getCustomerAccountStatus())) {
+                       return false;
+               } else if (!Objects.equals(this.getCustomerConfirmKey(), other.getCustomerConfirmKey())) {
                        return false;
                } else if (!Objects.equals(this.getCustomerContact(), other.getCustomerContact())) {
                        return false;
                } else if (!Objects.equals(this.getCustomerId(), other.getCustomerId())) {
                        return false;
+               } else if (!Objects.equals(this.getCustomerLastLocked(), other.getCustomerLastLocked())) {
+                       return false;
+               } else if (!Objects.equals(this.getCustomerLastLockedReason(), other.getCustomerLastLockedReason())) {
+                       return false;
+               } else if (!Objects.equals(this.getCustomerNumber(), other.getCustomerNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getCustomerPasswordHash(), other.getCustomerPasswordHash())) {
+                       return false;
                }
 
                return true;
@@ -246,14 +256,26 @@ public class ContactCustomer implements Customer {
 
        @Override
        @SuppressWarnings ("ReturnOfDateField")
-       public Date getCustomerCreated () {
-               return this.customerCreated;
+       public Date getCustomerEntryCreated () {
+               return this.customerEntryCreated;
        }
 
        @Override
        @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setCustomerCreated (final Date customerCreated) {
-               this.customerCreated = customerCreated;
+       public void setCustomerEntryCreated (final Date customerEntryCreated) {
+               this.customerEntryCreated = customerEntryCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getCustomerEntryUpdated () {
+               return this.customerEntryUpdated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setCustomerEntryUpdated (final Date customerEntryUpdated) {
+               this.customerEntryUpdated = customerEntryUpdated;
        }
 
        @Override
@@ -308,25 +330,18 @@ public class ContactCustomer implements Customer {
                throw new UnsupportedOperationException("Unfinished"); //NOI18N
        }
 
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getCustomerUpdated () {
-               return this.customerUpdated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setCustomerUpdated (final Date customerUpdated) {
-               this.customerUpdated = customerUpdated;
-       }
-
        @Override
        public int hashCode () {
                int hash = 7;
 
+               hash = 53 * hash + Objects.hashCode(this.getCustomerAccountStatus());
+               hash = 53 * hash + Objects.hashCode(this.getCustomerConfirmKey());
                hash = 53 * hash + Objects.hashCode(this.getCustomerContact());
                hash = 53 * hash + Objects.hashCode(this.getCustomerId());
+               hash = 53 * hash + Objects.hashCode(this.getCustomerLastLocked());
+               hash = 53 * hash + Objects.hashCode(this.getCustomerLastLockedReason());
                hash = 53 * hash + Objects.hashCode(this.getCustomerNumber());
+               hash = 53 * hash + Objects.hashCode(this.getCustomerPasswordHash());
 
                return hash;
        }
index 1a9a0efb3fd9c7fd81bb8c2d1f9620d2764cae14..97ac291e20ffe114b077125f634ae647ca575603 100644 (file)
@@ -61,28 +61,28 @@ public interface Customer extends Comparable<Customer>, Serializable {
         * <p>
         * @return "created" timestamp
         */
-       Date getCustomerCreated ();
+       Date getCustomerEntryCreated ();
 
        /**
         * Setter for "created" timestamp
         * <p>
-        * @param customerCreated "created" timestamp
+        * @param customerEntryCreated "created" timestamp
         */
-       void setCustomerCreated (final Date customerCreated);
+       void setCustomerEntryCreated (final Date customerEntryCreated);
 
        /**
         * Getter for "updated" timestamp
         * <p>
         * @return "updated" timestamp
         */
-       Date getCustomerUpdated ();
+       Date getCustomerEntryUpdated ();
 
        /**
         * Setter for "updated" timestamp
         * <p>
-        * @param customerUpdated "updated" timestamp
+        * @param customerEntryUpdated "updated" timestamp
         */
-       void setCustomerUpdated (final Date customerUpdated);
+       void setCustomerEntryUpdated (final Date customerEntryUpdated);
 
        /**
         * Getter for customer id number