From e3ac202e1d2f7c93f53904c37943085c20e736e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 26 Apr 2020 22:24:42 +0200 Subject: [PATCH] Continued: - cannot take these enitity references into comparison as this would result in an endless loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/basicdata/BusinessBasicData.java | 9 --------- .../model/branchoffice/BusinessBranchOffice.java | 16 ++++++---------- .../model/headquarter/BusinessHeadquarter.java | 3 --- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java b/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java index d7a4c53..f5a9f9d 100644 --- a/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java +++ b/src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java @@ -265,16 +265,10 @@ public class BusinessBasicData implements BasicData { return false; } else if (!Objects.equals(this.getCompanyComments(), other.getCompanyComments())) { return false; - } else if (!Objects.equals(this.getCompanyContactEmployee(), other.getCompanyContactEmployee())) { - return false; } else if (!Objects.equals(this.getCompanyEmailAddress(), other.getCompanyEmailAddress())) { return false; } else if (!Objects.equals(this.getCompanyFaxNumber(), other.getCompanyFaxNumber())) { return false; - } else if (!Objects.equals(this.getCompanyFounder(), other.getCompanyFounder())) { - return false; - } else if (!Objects.equals(this.getCompanyHeadquarterData(), other.getCompanyHeadquarterData())) { - return false; } else if (!Objects.equals(this.getCompanyLandLineNumber(), other.getCompanyLandLineNumber())) { return false; } else if (!Objects.equals(this.getCompanyLogo(), other.getCompanyLogo())) { @@ -488,11 +482,8 @@ public class BusinessBasicData implements BasicData { hash = 37 * hash + Objects.hashCode(this.getBasicDataId()); hash = 37 * hash + Objects.hashCode(this.getCompanyComments()); - hash = 37 * hash + Objects.hashCode(this.getCompanyContactEmployee()); hash = 37 * hash + Objects.hashCode(this.getCompanyEmailAddress()); hash = 37 * hash + Objects.hashCode(this.getCompanyFaxNumber()); - hash = 37 * hash + Objects.hashCode(this.getCompanyFounder()); - hash = 37 * hash + Objects.hashCode(this.getCompanyHeadquarterData()); hash = 37 * hash + Objects.hashCode(this.getCompanyLandLineNumber()); hash = 37 * hash + Objects.hashCode(this.getCompanyLogo()); hash = 37 * hash + Objects.hashCode(this.getCompanyName()); diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java index 32ee4c9..5d8f272 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java @@ -56,6 +56,7 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.Users; /** * A POJO for company branch offices @@ -327,6 +328,8 @@ public class BusinessBranchOffice implements BranchOffice { this.getBranchCompany().compareTo(branchOffice.getBranchCompany()), // ... branch office number SafeNumberUtils.compare(this.getBranchNumber(), branchOffice.getBranchNumber()), + // ... owner employee + Employees.compare(this.getBranchOwnerEmployee(), branchOffice.getBranchOwnerEmployee()), // ... contact person Employees.compare(this.getBranchContactEmployee(), branchOffice.getBranchContactEmployee()), // ... then country @@ -346,7 +349,9 @@ public class BusinessBranchOffice implements BranchOffice { // ... store ... SafeNumberUtils.compare(this.getBranchStore(), branchOffice.getBranchStore()), // ... suite number ... - SafeNumberUtils.compare(this.getBranchSuiteNumber(), branchOffice.getBranchSuiteNumber()) + SafeNumberUtils.compare(this.getBranchSuiteNumber(), branchOffice.getBranchSuiteNumber()), + // ... owning user + Users.compare(this.getBranchUserOwner(), branchOffice.getBranchUserOwner()) }; // Check all values @@ -371,8 +376,6 @@ public class BusinessBranchOffice implements BranchOffice { return false; } else if (!Objects.equals(this.getBranchCompany(), branchOffice.getBranchCompany())) { return false; - } else if (!Objects.equals(this.getBranchContactEmployee(), branchOffice.getBranchContactEmployee())) { - return false; } else if (!Objects.equals(this.getBranchCountry(), branchOffice.getBranchCountry())) { return false; } else if (!Objects.equals(this.getBranchEmailAddress(), branchOffice.getBranchEmailAddress())) { @@ -389,10 +392,6 @@ public class BusinessBranchOffice implements BranchOffice { return false; } else if (!Objects.equals(this.getBranchNumber(), branchOffice.getBranchNumber())) { return false; - } else if (!Objects.equals(this.getBranchOpeningTimes(), branchOffice.getBranchOpeningTimes())) { - return false; - } else if (!Objects.equals(this.getBranchOwnerEmployee(), branchOffice.getBranchOwnerEmployee())) { - return false; } else if (!Objects.equals(this.getBranchStore(), branchOffice.getBranchStore())) { return false; } else if (!Objects.equals(this.getBranchStreet(), branchOffice.getBranchStreet())) { @@ -630,7 +629,6 @@ public class BusinessBranchOffice implements BranchOffice { hash = 53 * hash + Objects.hashCode(this.getBranchCity()); hash = 53 * hash + Objects.hashCode(this.getBranchCompany()); - hash = 53 * hash + Objects.hashCode(this.getBranchContactEmployee()); hash = 53 * hash + Objects.hashCode(this.getBranchCountry()); hash = 53 * hash + Objects.hashCode(this.getBranchEmailAddress()); hash = 53 * hash + Objects.hashCode(this.getBranchFaxNumber()); @@ -640,8 +638,6 @@ public class BusinessBranchOffice implements BranchOffice { hash = 53 * hash + Objects.hashCode(this.getBranchLandLineNumber()); hash = 53 * hash + Objects.hashCode(this.getBranchLastHouseNumber()); hash = 53 * hash + Objects.hashCode(this.getBranchNumber()); - hash = 53 * hash + Objects.hashCode(this.getBranchOpeningTimes()); - hash = 53 * hash + Objects.hashCode(this.getBranchOwnerEmployee()); hash = 53 * hash + Objects.hashCode(this.getBranchStore()); hash = 53 * hash + Objects.hashCode(this.getBranchStreet()); hash = 53 * hash + Objects.hashCode(this.getBranchSuiteNumber()); diff --git a/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java b/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java index 3628640..c12496f 100644 --- a/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java +++ b/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java @@ -362,8 +362,6 @@ public class BusinessHeadquarter implements Headquarter { return false; } else if (!Objects.equals(this.getHeadquarterLastHouseNumber(), headquarter.getHeadquarterLastHouseNumber())) { return false; - } else if (!Objects.equals(this.getHeadquarterOpeningTimes(), headquarter.getHeadquarterOpeningTimes())) { - return false; } else if (!Objects.equals(this.getHeadquarterStore(), headquarter.getHeadquarterStore())) { return false; } else if (!Objects.equals(this.getHeadquarterStreet(), headquarter.getHeadquarterStreet())) { @@ -590,7 +588,6 @@ public class BusinessHeadquarter implements Headquarter { hash = 47 * hash + Objects.hashCode(this.getHeadquarterId()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterLandLineNumber()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterLastHouseNumber()); - hash = 47 * hash + Objects.hashCode(this.getHeadquarterOpeningTimes()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterStore()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterStreet()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterSuiteNumber()); -- 2.39.5