import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
-import org.mxchange.jcontactsbusiness.model.logo.BusinessLogo;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.logo.Logo;
/**
* A POJI for business contact classes
* <p>
* @return Company logo
*/
- BusinessLogo getCompanyLogo ();
+ Logo getCompanyLogo ();
/**
* Setter for company logo
* <p>
* @param companyLogo Company logo
*/
- void setCompanyLogo (final BusinessLogo companyLogo);
+ void setCompanyLogo (final Logo companyLogo);
/**
* Getter for company name
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData;
+import org.mxchange.jcontactsbusiness.model.headquarters.BusinessHeadquartersData;
import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
import org.mxchange.jcontactsbusiness.model.logo.BusinessLogo;
-import org.mxchange.jcontactsbusiness.model.logo.CompanyLogo;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
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.jcontactsbusiness.model.logo.Logo;
/**
* A POJO for business basic data
* Reference to headquarters data
*/
@JoinColumn (name = "company_headquarters_data_id")
- @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.ALL)
+ @OneToOne (targetEntity = BusinessHeadquartersData.class, cascade = CascadeType.ALL)
private HeadquartersData companyHeadQuartersData;
/**
* Id number of company logo
*/
@JoinColumn (name = "company_logo_id")
- @OneToOne (targetEntity = CompanyLogo.class, cascade = CascadeType.ALL)
- private BusinessLogo companyLogo;
+ @OneToOne (targetEntity = BusinessLogo.class, cascade = CascadeType.ALL)
+ private Logo companyLogo;
/**
* Company name
}
@Override
- public BusinessLogo getCompanyLogo () {
+ public Logo getCompanyLogo () {
return this.companyLogo;
}
@Override
- public void setCompanyLogo (final BusinessLogo companyLogoId) {
+ public void setCompanyLogo (final Logo companyLogoId) {
this.companyLogo = companyLogoId;
}
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData;
+import org.mxchange.jcontactsbusiness.model.headquarters.BusinessHeadquartersData;
import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
* Where this department is located
*/
@JoinColumn (name = "department_headquarters_id")
- @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
+ @OneToOne (targetEntity = BusinessHeadquartersData.class, cascade = CascadeType.REFRESH)
private HeadquartersData departmentHeadquarters;
/**
import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment;
import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData;
+import org.mxchange.jcontactsbusiness.model.headquarters.BusinessHeadquartersData;
import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
import org.mxchange.jcontactsbusiness.model.jobposition.EmployeePosition;
import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
* Head quarters id number (if the employee works there)
*/
@JoinColumn (name = "employee_headquarters_id")
- @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
+ @OneToOne (targetEntity = BusinessHeadquartersData.class, cascade = CascadeType.REFRESH)
private HeadquartersData employeeHeadquarter;
/**
--- /dev/null
+/*
+ * Copyright (C) 2016 KLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness.model.headquarters;
+
+import java.util.Date;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jcountry.model.data.CountryData;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
+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;
+
+/**
+ * A POJO for company headquarts data
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "company_headquarters")
+@Table (name = "company_headquarters")
+@SuppressWarnings ("PersistenceUnitPresent")
+public class BusinessHeadquartersData implements HeadquartersData {
+
+ /**
+ * Serial number
+ */
+ @Transient
+ private static final long serialVersionUID = 385_752_948_781_761L;
+
+ /**
+ * Headquarters' city name
+ */
+ @Basic (optional = false)
+ @Column (name = "headquarters_city", length = 100, nullable = false)
+ private String headquartersCity;
+
+ /**
+ * Headquarter's country code
+ */
+ @JoinColumn (name = "headquarters_country_id", nullable = false)
+ @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
+ private Country headquartersCountry;
+
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "headquarters_entry_created", nullable = false, updatable = false)
+ private Date headquartersCreated;
+
+ /**
+ * Headquarters' fax number
+ */
+ @JoinColumn (name = "headquarters_fax_number_id")
+ @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
+ private DialableFaxNumber headquartersFaxNumber;
+
+ /**
+ * Headquarters' house number
+ */
+ @Basic (optional = false)
+ @Column (name = "headquarters_house_number", length = 4, nullable = false)
+ private Short headquartersHouseNumber;
+
+ /**
+ * Id number
+ */
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ @Column (name = "headquarters_id", nullable = false, updatable = false)
+ private Long headquartersId;
+
+ /**
+ * Headquarters' phone number
+ */
+ @JoinColumn (name = "headquarters_phone_number_id")
+ @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+ private DialableLandLineNumber headquartersPhoneNumber;
+
+ /**
+ * Headquarters' store number (multi-store building only)
+ */
+ @Column (name = "headquarters_store", length = 3)
+ private Short headquartersStore;
+
+ /**
+ * Headquarters' street name
+ */
+ @Basic (optional = false)
+ @Column (name = "headquarters_street", length = 100, nullable = false)
+ private String headquartersStreet;
+
+ /**
+ * Headquarters' suite number
+ */
+ @Column (name = "headquarters_suite_number", length = 4)
+ private Short headquartersSuiteNumber;
+
+ /**
+ * User owner instance
+ */
+ @JoinColumn (name = "headquarters_user_id", nullable = false, updatable = false)
+ @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+ private User headquartersUserOwner;
+
+ /**
+ * Headquarters' ZIP code
+ */
+ @Basic (optional = false)
+ @Column (name = "headquarters_zip_code", length = 6, nullable = false)
+ private Integer headquartersZipCode;
+
+ @Override
+ public boolean equals (final Object object) {
+ if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final HeadquartersData other = (HeadquartersData) object;
+
+ if (!Objects.equals(this.getHeadquartersId(), other.getHeadquartersId())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersCity(), other.getHeadquartersCity())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersCountry(), other.getHeadquartersCountry())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersHouseNumber(), other.getHeadquartersHouseNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersStore(), other.getHeadquartersStore())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersStreet(), other.getHeadquartersStreet())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersSuiteNumber(), other.getHeadquartersSuiteNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getHeadquartersZipCode(), other.getHeadquartersZipCode())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public String getHeadquartersCity () {
+ return this.headquartersCity;
+ }
+
+ @Override
+ public void setHeadquartersCity (final String headquartersCity) {
+ this.headquartersCity = headquartersCity;
+ }
+
+ @Override
+ public Country getHeadquartersCountry () {
+ return this.headquartersCountry;
+ }
+
+ @Override
+ public void setHeadquartersCountry (final Country headquartersCountry) {
+ this.headquartersCountry = headquartersCountry;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Date getHeadquartersCreated () {
+ return this.headquartersCreated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setHeadquartersCreated (final Date headquartersCreated) {
+ this.headquartersCreated = headquartersCreated;
+ }
+
+ @Override
+ public DialableFaxNumber getHeadquartersFaxNumber () {
+ return this.headquartersFaxNumber;
+ }
+
+ @Override
+ public void setHeadquartersFaxNumber (final DialableFaxNumber headquartersFaxNumber) {
+ this.headquartersFaxNumber = headquartersFaxNumber;
+ }
+
+ @Override
+ public Short getHeadquartersHouseNumber () {
+ return this.headquartersHouseNumber;
+ }
+
+ @Override
+ public void setHeadquartersHouseNumber (final Short headquartersHouseNumber) {
+ this.headquartersHouseNumber = headquartersHouseNumber;
+ }
+
+ @Override
+ public Long getHeadquartersId () {
+ return this.headquartersId;
+ }
+
+ @Override
+ public void setHeadquartersId (final Long headquartersId) {
+ this.headquartersId = headquartersId;
+ }
+
+ @Override
+ public DialableLandLineNumber getHeadquartersPhoneNumber () {
+ return this.headquartersPhoneNumber;
+ }
+
+ @Override
+ public void setHeadquartersPhoneNumber (final DialableLandLineNumber headquartersPhoneNumber) {
+ this.headquartersPhoneNumber = headquartersPhoneNumber;
+ }
+
+ @Override
+ public Short getHeadquartersStore () {
+ return this.headquartersStore;
+ }
+
+ @Override
+ public void setHeadquartersStore (final Short headquartersStore) {
+ this.headquartersStore = headquartersStore;
+ }
+
+ @Override
+ public String getHeadquartersStreet () {
+ return this.headquartersStreet;
+ }
+
+ @Override
+ public void setHeadquartersStreet (final String headquartersStreet) {
+ this.headquartersStreet = headquartersStreet;
+ }
+
+ @Override
+ public Short getHeadquartersSuiteNumber () {
+ return this.headquartersSuiteNumber;
+ }
+
+ @Override
+ public void setHeadquartersSuiteNumber (final Short headquartersSuiteNumber) {
+ this.headquartersSuiteNumber = headquartersSuiteNumber;
+ }
+
+ @Override
+ public User getHeadquartersUserOwner () {
+ return this.headquartersUserOwner;
+ }
+
+ @Override
+ public void setHeadquartersUserOwner (final User headquartersUserOwner) {
+ this.headquartersUserOwner = headquartersUserOwner;
+ }
+
+ @Override
+ public Integer getHeadquartersZipCode () {
+ return this.headquartersZipCode;
+ }
+
+ @Override
+ public void setHeadquartersZipCode (final Integer headquartersZipCode) {
+ this.headquartersZipCode = headquartersZipCode;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersId());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersCity());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersCountry());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersHouseNumber());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersStore());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersStreet());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersSuiteNumber());
+ hash = 47 * hash + Objects.hashCode(this.getHeadquartersZipCode());
+
+ return hash;
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016 KLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcontactsbusiness.model.headquarters;
-
-import java.util.Date;
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jcountry.model.data.CountryData;
-import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
-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;
-
-/**
- * A POJO for company headquarts data
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_headquarters")
-@Table (name = "company_headquarters")
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyHeadquartersData implements HeadquartersData {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 385_752_948_781_761L;
-
- /**
- * Headquarters' city name
- */
- @Basic (optional = false)
- @Column (name = "headquarters_city", length = 100, nullable = false)
- private String headquartersCity;
-
- /**
- * Headquarter's country code
- */
- @JoinColumn (name = "headquarters_country_id", nullable = false)
- @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
- private Country headquartersCountry;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "headquarters_entry_created", nullable = false, updatable = false)
- private Date headquartersCreated;
-
- /**
- * Headquarters' fax number
- */
- @JoinColumn (name = "headquarters_fax_number_id")
- @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
- private DialableFaxNumber headquartersFaxNumber;
-
- /**
- * Headquarters' house number
- */
- @Basic (optional = false)
- @Column (name = "headquarters_house_number", length = 4, nullable = false)
- private Short headquartersHouseNumber;
-
- /**
- * Id number
- */
- @Id
- @GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "headquarters_id", nullable = false, updatable = false)
- private Long headquartersId;
-
- /**
- * Headquarters' phone number
- */
- @JoinColumn (name = "headquarters_phone_number_id")
- @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
- private DialableLandLineNumber headquartersPhoneNumber;
-
- /**
- * Headquarters' store number (multi-store building only)
- */
- @Column (name = "headquarters_store", length = 3)
- private Short headquartersStore;
-
- /**
- * Headquarters' street name
- */
- @Basic (optional = false)
- @Column (name = "headquarters_street", length = 100, nullable = false)
- private String headquartersStreet;
-
- /**
- * Headquarters' suite number
- */
- @Column (name = "headquarters_suite_number", length = 4)
- private Short headquartersSuiteNumber;
-
- /**
- * User owner instance
- */
- @JoinColumn (name = "headquarters_user_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
- private User headquartersUserOwner;
-
- /**
- * Headquarters' ZIP code
- */
- @Basic (optional = false)
- @Column (name = "headquarters_zip_code", length = 6, nullable = false)
- private Integer headquartersZipCode;
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.getClass() != object.getClass()) {
- return false;
- }
-
- final HeadquartersData other = (HeadquartersData) object;
-
- if (!Objects.equals(this.getHeadquartersId(), other.getHeadquartersId())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersCity(), other.getHeadquartersCity())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersCountry(), other.getHeadquartersCountry())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersHouseNumber(), other.getHeadquartersHouseNumber())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersStore(), other.getHeadquartersStore())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersStreet(), other.getHeadquartersStreet())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersSuiteNumber(), other.getHeadquartersSuiteNumber())) {
- return false;
- } else if (!Objects.equals(this.getHeadquartersZipCode(), other.getHeadquartersZipCode())) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public String getHeadquartersCity () {
- return this.headquartersCity;
- }
-
- @Override
- public void setHeadquartersCity (final String headquartersCity) {
- this.headquartersCity = headquartersCity;
- }
-
- @Override
- public Country getHeadquartersCountry () {
- return this.headquartersCountry;
- }
-
- @Override
- public void setHeadquartersCountry (final Country headquartersCountry) {
- this.headquartersCountry = headquartersCountry;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Date getHeadquartersCreated () {
- return this.headquartersCreated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setHeadquartersCreated (final Date headquartersCreated) {
- this.headquartersCreated = headquartersCreated;
- }
-
- @Override
- public DialableFaxNumber getHeadquartersFaxNumber () {
- return this.headquartersFaxNumber;
- }
-
- @Override
- public void setHeadquartersFaxNumber (final DialableFaxNumber headquartersFaxNumber) {
- this.headquartersFaxNumber = headquartersFaxNumber;
- }
-
- @Override
- public Short getHeadquartersHouseNumber () {
- return this.headquartersHouseNumber;
- }
-
- @Override
- public void setHeadquartersHouseNumber (final Short headquartersHouseNumber) {
- this.headquartersHouseNumber = headquartersHouseNumber;
- }
-
- @Override
- public Long getHeadquartersId () {
- return this.headquartersId;
- }
-
- @Override
- public void setHeadquartersId (final Long headquartersId) {
- this.headquartersId = headquartersId;
- }
-
- @Override
- public DialableLandLineNumber getHeadquartersPhoneNumber () {
- return this.headquartersPhoneNumber;
- }
-
- @Override
- public void setHeadquartersPhoneNumber (final DialableLandLineNumber headquartersPhoneNumber) {
- this.headquartersPhoneNumber = headquartersPhoneNumber;
- }
-
- @Override
- public Short getHeadquartersStore () {
- return this.headquartersStore;
- }
-
- @Override
- public void setHeadquartersStore (final Short headquartersStore) {
- this.headquartersStore = headquartersStore;
- }
-
- @Override
- public String getHeadquartersStreet () {
- return this.headquartersStreet;
- }
-
- @Override
- public void setHeadquartersStreet (final String headquartersStreet) {
- this.headquartersStreet = headquartersStreet;
- }
-
- @Override
- public Short getHeadquartersSuiteNumber () {
- return this.headquartersSuiteNumber;
- }
-
- @Override
- public void setHeadquartersSuiteNumber (final Short headquartersSuiteNumber) {
- this.headquartersSuiteNumber = headquartersSuiteNumber;
- }
-
- @Override
- public User getHeadquartersUserOwner () {
- return this.headquartersUserOwner;
- }
-
- @Override
- public void setHeadquartersUserOwner (final User headquartersUserOwner) {
- this.headquartersUserOwner = headquartersUserOwner;
- }
-
- @Override
- public Integer getHeadquartersZipCode () {
- return this.headquartersZipCode;
- }
-
- @Override
- public void setHeadquartersZipCode (final Integer headquartersZipCode) {
- this.headquartersZipCode = headquartersZipCode;
- }
-
- @Override
- public int hashCode () {
- int hash = 7;
-
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersId());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersCity());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersCountry());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersHouseNumber());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersStore());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersStreet());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersSuiteNumber());
- hash = 47 * hash + Objects.hashCode(this.getHeadquartersZipCode());
-
- return hash;
- }
-
-}
*/
package org.mxchange.jcontactsbusiness.model.logo;
-import java.io.Serializable;
import java.util.Date;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
/**
- * A POJI for business logos
+ * A POJO for company logos
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public interface BusinessLogo extends Serializable {
+@Entity (name = "company_logos")
+@Table (name = "company_logos")
+@SuppressWarnings ("PersistenceUnitPresent")
+public class BusinessLogo implements Logo {
/**
- * Getter for logo's local file name
- * <p>
- * @return Logo's local file name
+ * Serial number
*/
- String getLogoFileName ();
+ @Transient
+ private static final long serialVersionUID = 475_871_875_718_751_285L;
/**
- * Setter for logo's local file name
- * <p>
- * @param logoFileName Logo's local file name
+ * Timestamp when this entry has been created
*/
- void setLogoFileName (final String logoFileName);
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "logo_entry_created", nullable = false, updatable = false)
+ private Date logoCreated;
/**
- * Getter for logo's id number
- * <p>
- * @return Logo's id number
+ * Local file name of the logo (relative to /resources/logos/)
*/
- Long getLogoId ();
+ @Basic (optional = false)
+ @Column (name = "logo_file_name", nullable = false, unique = true, updatable = false)
+ private String logoFileName;
/**
- * Setter for logo's id number
- * <p>
- * @param logoId Logo's id number
+ * Id number
*/
- void setLogoId (final Long logoId);
+ @Id
+ @GeneratedValue (strategy = GenerationType.IDENTITY)
+ @Column (name = "logo_id", nullable = false, updatable = false)
+ private Long logoId;
/**
- * Getter for user owner instance
- * <p>
- * @return User owner instance
+ * Logo uploader user instance
*/
- User getLogoUploader ();
+ @JoinColumn (name = "logo_uploader_id", nullable = false, updatable = false)
+ @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+ private User logoUploader;
- /**
- * Setter for user owner instance
- * <p>
- * @param logoUploader User owner instance
- */
- void setLogoUploader (final User logoUploader);
+ @Override
+ public boolean equals (final Object object) {
+ if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
- /**
- * Getter for timestamp when this entry has been created
- * <p>
- * @return Timestamp when this entry has been created
- */
- Date getLogoCreated ();
+ final Logo other = (Logo) object;
- /**
- * Setter for timestamp when this entry has been created
- * <p>
- * @param logoCreated Timestamp when this entry has been created
- */
- void setLogoCreated (final Date logoCreated);
+ if (!Objects.equals(this.getLogoId(), other.getLogoId())) {
+ return false;
+ } else if (!Objects.equals(this.getLogoUploader(), other.getLogoUploader())) {
+ return false;
+ } else if (!Objects.equals(this.getLogoFileName(), other.getLogoFileName())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Date getLogoCreated () {
+ return this.logoCreated;
+ }
@Override
- boolean equals (final Object object);
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setLogoCreated (final Date logoCreated) {
+ this.logoCreated = logoCreated;
+ }
@Override
- int hashCode ();
+ public String getLogoFileName () {
+ return this.logoFileName;
+ }
+
+ @Override
+ public void setLogoFileName (final String logoFileName) {
+ this.logoFileName = logoFileName;
+ }
+
+ @Override
+ public Long getLogoId () {
+ return this.logoId;
+ }
+
+ @Override
+ public void setLogoId (final Long logoId) {
+ this.logoId = logoId;
+ }
+
+ @Override
+ public User getLogoUploader () {
+ return this.logoUploader;
+ }
+
+ @Override
+ public void setLogoUploader (final User logoUploader) {
+ this.logoUploader = logoUploader;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 3;
+
+ hash = 53 * hash + Objects.hashCode(this.getLogoId());
+ hash = 53 * hash + Objects.hashCode(this.getLogoFileName());
+ hash = 53 * hash + Objects.hashCode(this.getLogoUploader());
+
+ return hash;
+ }
+
}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcontactsbusiness.model.logo;
-
-import java.util.Date;
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jusercore.model.user.LoginUser;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A POJO for company logos
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_logos")
-@Table (name = "company_logos")
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyLogo implements BusinessLogo {
-
- /**
- * Serial number
- */
- @Transient
- private static final long serialVersionUID = 475_871_875_718_751_285L;
-
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "logo_entry_created", nullable = false, updatable = false)
- private Date logoCreated;
-
- /**
- * Local file name of the logo (relative to /resources/logos/)
- */
- @Basic (optional = false)
- @Column (name = "logo_file_name", nullable = false, unique = true, updatable = false)
- private String logoFileName;
-
- /**
- * Id number
- */
- @Id
- @GeneratedValue (strategy = GenerationType.IDENTITY)
- @Column (name = "logo_id", nullable = false, updatable = false)
- private Long logoId;
-
- /**
- * Logo uploader user instance
- */
- @JoinColumn (name = "logo_uploader_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
- private User logoUploader;
-
- @Override
- public boolean equals (final Object object) {
- if (null == object) {
- return false;
- } else if (this.getClass() != object.getClass()) {
- return false;
- }
-
- final BusinessLogo other = (BusinessLogo) object;
-
- if (!Objects.equals(this.getLogoId(), other.getLogoId())) {
- return false;
- } else if (!Objects.equals(this.getLogoUploader(), other.getLogoUploader())) {
- return false;
- } else if (!Objects.equals(this.getLogoFileName(), other.getLogoFileName())) {
- return false;
- }
-
- return true;
- }
-
- @Override
- @SuppressWarnings ("ReturnOfDateField")
- public Date getLogoCreated () {
- return this.logoCreated;
- }
-
- @Override
- @SuppressWarnings ("AssignmentToDateFieldFromParameter")
- public void setLogoCreated (final Date logoCreated) {
- this.logoCreated = logoCreated;
- }
-
- @Override
- public String getLogoFileName () {
- return this.logoFileName;
- }
-
- @Override
- public void setLogoFileName (final String logoFileName) {
- this.logoFileName = logoFileName;
- }
-
- @Override
- public Long getLogoId () {
- return this.logoId;
- }
-
- @Override
- public void setLogoId (final Long logoId) {
- this.logoId = logoId;
- }
-
- @Override
- public User getLogoUploader () {
- return this.logoUploader;
- }
-
- @Override
- public void setLogoUploader (final User logoUploader) {
- this.logoUploader = logoUploader;
- }
-
- @Override
- public int hashCode () {
- int hash = 3;
-
- hash = 53 * hash + Objects.hashCode(this.getLogoId());
- hash = 53 * hash + Objects.hashCode(this.getLogoFileName());
- hash = 53 * hash + Objects.hashCode(this.getLogoUploader());
-
- return hash;
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness.model.logo;
+
+import java.io.Serializable;
+import java.util.Date;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJI for business logos
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface Logo extends Serializable {
+
+ /**
+ * Getter for logo's local file name
+ * <p>
+ * @return Logo's local file name
+ */
+ String getLogoFileName ();
+
+ /**
+ * Setter for logo's local file name
+ * <p>
+ * @param logoFileName Logo's local file name
+ */
+ void setLogoFileName (final String logoFileName);
+
+ /**
+ * Getter for logo's id number
+ * <p>
+ * @return Logo's id number
+ */
+ Long getLogoId ();
+
+ /**
+ * Setter for logo's id number
+ * <p>
+ * @param logoId Logo's id number
+ */
+ void setLogoId (final Long logoId);
+
+ /**
+ * Getter for user owner instance
+ * <p>
+ * @return User owner instance
+ */
+ User getLogoUploader ();
+
+ /**
+ * Setter for user owner instance
+ * <p>
+ * @param logoUploader User owner instance
+ */
+ void setLogoUploader (final User logoUploader);
+
+ /**
+ * Getter for timestamp when this entry has been created
+ * <p>
+ * @return Timestamp when this entry has been created
+ */
+ Date getLogoCreated ();
+
+ /**
+ * Setter for timestamp when this entry has been created
+ * <p>
+ * @param logoCreated Timestamp when this entry has been created
+ */
+ void setLogoCreated (final Date logoCreated);
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+}