]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
renamed property to make it more clear, companyId was not really clear.
authorRoland Häder <roland@mxchange.org>
Thu, 8 Jun 2017 18:56:35 +0000 (20:56 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 8 Jun 2017 18:57:54 +0000 (20:57 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/BusinessContact.java
src/org/mxchange/jcontactsbusiness/CompanyContact.java

index 00b197c4462da3fc7162ab5819fd7a1c8f6494b8..df21de424bb0d9f3bf0ed34aafe4d260f6acb8b2 100644 (file)
@@ -75,18 +75,18 @@ public interface BusinessContact extends Serializable {
        void setCompanyContact (final Employee companyContact);
 
        /**
-        * Getter for basic company data
+        * Getter for business contact id
         * <p>
-        * @return Basic company data
+        * @return Business contact id
         */
-       Long getCompanyId ();
+       Long getBusinessContactId ();
 
        /**
-        * Setter for basic company data
+        * Setter for business contact id
         * <p>
-        * @param companyContactId Basic company data
+        * @param businessContactId Business contact id
         */
-       void setCompanyId (final Long companyContactId);
+       void setBusinessContactId (final Long businessContactId);
 
        /**
         * Getter for company founder
index f0363d60fa74eed741f8ce4c397d99fe83d5a673..3d1c9b9eda4ada37f8a2cefec2a34abfd9c6d553 100644 (file)
@@ -71,6 +71,14 @@ public class CompanyContact implements BusinessContact {
        @Transient
        private List<BranchOffice> brancheOffices;
 
+       /**
+        * Id number
+        */
+       @Id
+       @Column (name = "business_contact_id", nullable = false, updatable = false)
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       private Long businessContactId;
+
        /**
         * Reference to contact person
         */
@@ -85,14 +93,6 @@ public class CompanyContact implements BusinessContact {
        @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
        private Employee companyFounder;
 
-       /**
-        * Id number
-        */
-       @Id
-       @Column (name = "company_id", nullable = false, updatable = false)
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       private Long companyId;
-
        /**
         * Timestamp when this entry has been created
         */
@@ -125,7 +125,7 @@ public class CompanyContact implements BusinessContact {
 
                final BusinessContact other = (BusinessContact) object;
 
-               if (!Objects.equals(this.getCompanyId(), other.getCompanyId())) {
+               if (!Objects.equals(this.getBusinessContactId(), other.getBusinessContactId())) {
                        return false;
                } else if (!Objects.equals(this.getCompanyContact(), other.getCompanyContact())) {
                        return false;
@@ -162,6 +162,16 @@ public class CompanyContact implements BusinessContact {
                this.brancheOffices = brancheOffices;
        }
 
+       @Override
+       public Long getBusinessContactId () {
+               return this.businessContactId;
+       }
+
+       @Override
+       public void setBusinessContactId (final Long businessContactId) {
+               this.businessContactId = businessContactId;
+       }
+
        @Override
        public Employee getCompanyContact () {
                return this.companyContact;
@@ -182,16 +192,6 @@ public class CompanyContact implements BusinessContact {
                this.companyFounder = companyFounder;
        }
 
-       @Override
-       public Long getCompanyId () {
-               return this.companyId;
-       }
-
-       @Override
-       public void setCompanyId (final Long companyId) {
-               this.companyId = companyId;
-       }
-
        @Override
        @SuppressWarnings ("ReturnOfDateField")
        public Calendar getContactCreated () {
@@ -228,7 +228,7 @@ public class CompanyContact implements BusinessContact {
        public int hashCode () {
                int hash = 3;
 
-               hash = 37 * hash + Objects.hashCode(this.getCompanyId());
+               hash = 37 * hash + Objects.hashCode(this.getBusinessContactId());
                hash = 37 * hash + Objects.hashCode(this.getCompanyContact());
                hash = 37 * hash + Objects.hashCode(this.getCompanyFounder());
                hash = 37 * hash + Objects.hashCode(this.getBasicBusinessData());