From: Roland Häder Date: Thu, 8 Jun 2017 18:56:35 +0000 (+0200) Subject: renamed property to make it more clear, companyId was not really clear. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eb43fc3b50a4e44814f807e709201778b92fdd5d;p=jcontacts-business-core.git renamed property to make it more clear, companyId was not really clear. Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcontactsbusiness/BusinessContact.java b/src/org/mxchange/jcontactsbusiness/BusinessContact.java index 00b197c..df21de4 100644 --- a/src/org/mxchange/jcontactsbusiness/BusinessContact.java +++ b/src/org/mxchange/jcontactsbusiness/BusinessContact.java @@ -75,18 +75,18 @@ public interface BusinessContact extends Serializable { void setCompanyContact (final Employee companyContact); /** - * Getter for basic company data + * Getter for business contact id *

- * @return Basic company data + * @return Business contact id */ - Long getCompanyId (); + Long getBusinessContactId (); /** - * Setter for basic company data + * Setter for business contact id *

- * @param companyContactId Basic company data + * @param businessContactId Business contact id */ - void setCompanyId (final Long companyContactId); + void setBusinessContactId (final Long businessContactId); /** * Getter for company founder diff --git a/src/org/mxchange/jcontactsbusiness/CompanyContact.java b/src/org/mxchange/jcontactsbusiness/CompanyContact.java index f0363d6..3d1c9b9 100644 --- a/src/org/mxchange/jcontactsbusiness/CompanyContact.java +++ b/src/org/mxchange/jcontactsbusiness/CompanyContact.java @@ -71,6 +71,14 @@ public class CompanyContact implements BusinessContact { @Transient private List 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());