From 1fc10e088686ff5838c22139832baaff078dcbef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 5 Nov 2017 12:31:43 +0100 Subject: [PATCH] Continued: - added branch office's last house number - added headquarter's last house number MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/branchoffice/BranchOffice.java | 14 +++ .../branchoffice/BusinessBranchOffice.java | 26 ++++- .../headquarter/BusinessHeadquarter.java | 28 +++++ .../model/headquarter/Headquarter.java | 102 ++++++++++-------- 4 files changed, 121 insertions(+), 49 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java index 9f9fa14..77a3ae8 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java @@ -90,6 +90,20 @@ public interface BranchOffice extends Serializable { */ void setBranchHouseNumber (final Short branchHouseNumber); + /** + * Getter for branch office's last house number + *

+ * @return Branch office's last house number + */ + Short getBranchLastHouseNumber (); + + /** + * Setter for branch office's last house number + *

+ * @param branchLastHouseNumber Branch office's last house number + */ + void setBranchLastHouseNumber (final Short branchLastHouseNumber); + /** * Getter for branch office's phone number *

diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java index a24b326..604355f 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java @@ -61,7 +61,7 @@ import org.mxchange.jusercore.model.user.User; @Table (name = "company_branch_offices") @NamedQueries ( { - @NamedQuery (name = "AllBranchOffices", query = "SELECT bo FROM company_branch_offices AS bo ORDER BY bo.branchId ASC"), + @NamedQuery (name = "AllBranchOffices", query = "SELECT bo FROM company_branch_offices AS bo ORDER BY bo.branchId ASC") } ) @SuppressWarnings ("PersistenceUnitPresent") @@ -126,7 +126,7 @@ public class BusinessBranchOffice implements BranchOffice { * Branch office's house number */ @Basic (optional = false) - @Column (name = "branch_house_number", length = 3, nullable = false) + @Column (name = "branch_house_number", nullable = false) private Short branchHouseNumber; /** @@ -144,6 +144,12 @@ public class BusinessBranchOffice implements BranchOffice { @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) private DialableLandLineNumber branchLandLineNumber; + /** + * Branch office's last house number + */ + @Column (name = "branch_last_house_number") + private Short branchLastHouseNumber; + /** * Numer of this branch office */ @@ -169,7 +175,7 @@ public class BusinessBranchOffice implements BranchOffice { /** * Branch office's store (if multiple-store building) */ - @Column (name = "branch_store", length = 3) + @Column (name = "branch_store") private Short branchStore; /** @@ -182,7 +188,7 @@ public class BusinessBranchOffice implements BranchOffice { /** * Branch office's suite number (if applyable) */ - @Column (name = "branch_suite_number", length = 4) + @Column (name = "branch_suite_number") private Short branchSuiteNumber; /** @@ -196,7 +202,7 @@ public class BusinessBranchOffice implements BranchOffice { * Branch office's ZIP code */ @Basic (optional = false) - @Column (name = "branch_zip_code", length = 6, nullable = false) + @Column (name = "branch_zip_code", nullable = false) private Integer branchZipCode; /** @@ -409,6 +415,16 @@ public class BusinessBranchOffice implements BranchOffice { this.branchLandLineNumber = branchLandLineNumber; } + @Override + public Short getBranchLastHouseNumber () { + return this.branchLastHouseNumber; + } + + @Override + public void setBranchLastHouseNumber (final Short branchLastHouseNumber) { + this.branchLastHouseNumber = branchLastHouseNumber; + } + @Override public Long getBranchNumber () { return this.branchNumber; diff --git a/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java b/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java index 4baeeaa..9cfe846 100644 --- a/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java +++ b/src/org/mxchange/jcontactsbusiness/model/headquarter/BusinessHeadquarter.java @@ -135,6 +135,12 @@ public class BusinessHeadquarter implements Headquarter { @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) private DialableLandLineNumber headquarterLandLineNumber; + /** + * Headquarter's last house number + */ + @Column (name = "headquarter_last_house_number") + private Short headquarterLastHouseNumber; + /** * Opening times for this branch office */ @@ -181,6 +187,15 @@ public class BusinessHeadquarter implements Headquarter { public BusinessHeadquarter () { } + /** + * Constructor with all required fields + *

+ * @param headquarterCity City + * @param headquarterCountry Country + * @param headquarterStreet Street name + * @param headquarterZipCode ZIP code + * @param headquarterHouseNumber House number + */ public BusinessHeadquarter (final String headquarterCity, final Country headquarterCountry, final String headquarterStreet, final Integer headquarterZipCode, final Short headquarterHouseNumber) { // Call other constructor first this(); @@ -247,6 +262,8 @@ public class BusinessHeadquarter implements Headquarter { return false; } else if (!Objects.equals(this.getHeadquarterHouseNumber(), headquarter.getHeadquarterHouseNumber())) { return false; + } else if (!Objects.equals(this.getHeadquarterLastHouseNumber(), headquarter.getHeadquarterLastHouseNumber())) { + return false; } else if (!Objects.equals(this.getHeadquarterStore(), headquarter.getHeadquarterStore())) { return false; } else if (!Objects.equals(this.getHeadquarterStreet(), headquarter.getHeadquarterStreet())) { @@ -352,6 +369,16 @@ public class BusinessHeadquarter implements Headquarter { this.headquarterLandLineNumber = headquarterLandLineNumber; } + @Override + public Short getHeadquarterLastHouseNumber () { + return this.headquarterLastHouseNumber; + } + + @Override + public void setHeadquarterLastHouseNumber (final Short headquarterLastHouseNumber) { + this.headquarterLastHouseNumber = headquarterLastHouseNumber; + } + @Override @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List getHeadquarterOpeningTimes () { @@ -422,6 +449,7 @@ public class BusinessHeadquarter implements Headquarter { hash = 47 * hash + Objects.hashCode(this.getHeadquarterCity()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterCountry()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterHouseNumber()); + hash = 47 * hash + Objects.hashCode(this.getHeadquarterLastHouseNumber()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterStore()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterStreet()); hash = 47 * hash + Objects.hashCode(this.getHeadquarterSuiteNumber()); diff --git a/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java b/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java index cc76d59..4db8fa5 100644 --- a/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java +++ b/src/org/mxchange/jcontactsbusiness/model/headquarter/Headquarter.java @@ -34,142 +34,156 @@ import org.mxchange.jusercore.model.user.User; public interface Headquarter extends Serializable { /** - * Getter for headquarter' city name + * Getter for headquarter's city name *

- * @return Headquarter' city name + * @return Headquarter's city name */ String getHeadquarterCity (); /** - * Setter for headquarter' city name + * Setter for headquarter's city name *

- * @param headquarterCity Headquarter' city name + * @param headquarterCity Headquarter's city name */ void setHeadquarterCity (final String headquarterCity); /** - * Getter for headquarter' country code + * Getter for headquarter's country code *

- * @return Headquarter' country code + * @return Headquarter's country code */ Country getHeadquarterCountry (); /** - * Setter for headquarter' country code + * Setter for headquarter's country code *

- * @param headquarterCountryCode Headquarter' country code + * @param headquarterCountryCode Headquarter's country code */ void setHeadquarterCountry (final Country headquarterCountryCode); /** - * Getter for headquarter' house number + * Getter for headquarter's house number *

- * @return Headquarter' house number + * @return Headquarter's house number */ Short getHeadquarterHouseNumber (); /** - * Setter for headquarter' house number + * Setter for headquarter's house number *

- * @param headquarterHouseNumber Headquarter' house number + * @param headquarterHouseNumber Headquarter's house number */ void setHeadquarterHouseNumber (final Short headquarterHouseNumber); /** - * Getter for headquarter' id number + * Getter for headquarter's last house number *

- * @return Headquarter' id number + * @return Headquarter's last house number + */ + Short getHeadquarterLastHouseNumber (); + + /** + * Setter for headquarter's last house number + *

+ * @param headquarterLastHouseNumber Headquarter's last house number + */ + void setHeadquarterLastHouseNumber (final Short headquarterLastHouseNumber); + + /** + * Getter for headquarter's id number + *

+ * @return Headquarter's id number */ Long getHeadquarterId (); /** - * Setter for headquarter' id number + * Setter for headquarter's id number *

- * @param headquarterId Headquarter' id number + * @param headquarterId Headquarter's id number */ void setHeadquarterId (final Long headquarterId); /** - * Getter for headquarter' store number + * Getter for headquarter's store number *

- * @return Headquarter' store number + * @return Headquarter's store number */ Short getHeadquarterStore (); /** - * Setter for headquarter' store number + * Setter for headquarter's store number *

- * @param headquarterStore Headquarter' store number + * @param headquarterStore Headquarter's store number */ void setHeadquarterStore (final Short headquarterStore); /** - * Getter for headquarter' street name + * Getter for headquarter's street name *

- * @return Headquarter' street name + * @return Headquarter's street name */ String getHeadquarterStreet (); /** - * Setter for headquarter' street name + * Setter for headquarter's street name *

- * @param headquarterStreet Headquarter' street name + * @param headquarterStreet Headquarter's street name */ void setHeadquarterStreet (final String headquarterStreet); /** - * Getter for headquarter' suite number + * Getter for headquarter's suite number *

- * @return Headquarter' suite number + * @return Headquarter's suite number */ Short getHeadquarterSuiteNumber (); /** - * Setter for headquarter' suite number + * Setter for headquarter's suite number *

- * @param headquarterSuiteNumber Headquarter' suite number + * @param headquarterSuiteNumber Headquarter's suite number */ void setHeadquarterSuiteNumber (final Short headquarterSuiteNumber); /** - * Getter for headquarter' ZIP code + * Getter for headquarter's ZIP code *

- * @return Headquarter' ZIP code + * @return Headquarter's ZIP code */ Integer getHeadquarterZipCode (); /** - * Setter for headquarter' ZIP code + * Setter for headquarter's ZIP code *

- * @param headquarterZipCode Headquarter' ZIP code + * @param headquarterZipCode Headquarter's ZIP code */ void setHeadquarterZipCode (final Integer headquarterZipCode); /** - * Getter for headquarter' land-line number + * Getter for headquarter's land-line number *

- * @return Headquarter' land-line number + * @return Headquarter's land-line number */ DialableLandLineNumber getHeadquarterLandLineNumber (); /** - * Setter for headquarter' land-line number + * Setter for headquarter's land-line number *

- * @param headquarterLandLineNumber Headquarter' land-line number + * @param headquarterLandLineNumber Headquarter's land-line number */ void setHeadquarterLandLineNumber (final DialableLandLineNumber headquarterLandLineNumber); /** - * Getter for headquarter' fax number + * Getter for headquarter's fax number *

- * @return Headquarter' fax number + * @return Headquarter's fax number */ DialableFaxNumber getHeadquarterFaxNumber (); /** - * Setter for headquarter' fax number + * Setter for headquarter's fax number *

- * @param headquarterFaxNumber Headquarter' fax number + * @param headquarterFaxNumber Headquarter's fax number */ void setHeadquarterFaxNumber (final DialableFaxNumber headquarterFaxNumber); @@ -216,16 +230,16 @@ public interface Headquarter extends Serializable { void setHeadquarterOpeningTimes (final List branchOpeningTimes); /** - * Getter for headquarter' email address + * Getter for headquarter's email address *

- * @return Headquarter' email address + * @return Headquarter's email address */ String getHeadquarterEmailAddress (); /** - * Setter for headquarter' email address + * Setter for headquarter's email address *

- * @param headquarterEmailAddress Headquarter' email address + * @param headquarterEmailAddress Headquarter's email address */ void setHeadquarterEmailAddress (final String headquarterEmailAddress); -- 2.39.5