]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Having basic data and "business contact" which is really no contact in general
authorRoland Häder <roland@mxchange.org>
Sun, 23 Jul 2017 11:49:34 +0000 (13:49 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 23 Jul 2017 15:58:04 +0000 (17:58 +0200)
terms was a bad style anyway. Now these two entities are merged into
"BusinessBasicData" and kept in main package of this project.

Signed-off-by: Roland Häder <roland@mxchange.org>
13 files changed:
src/org/mxchange/jcontactsbusiness/BusinessBasicData.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/BusinessContact.java [deleted file]
src/org/mxchange/jcontactsbusiness/CompanyBasicData.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/CompanyContact.java [deleted file]
src/org/mxchange/jcontactsbusiness/basicdata/BusinessBasicData.java [deleted file]
src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java [deleted file]
src/org/mxchange/jcontactsbusiness/branch/BranchOffice.java
src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java
src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java
src/org/mxchange/jcontactsbusiness/department/Department.java
src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java
src/org/mxchange/jcontactsbusiness/employee/Employee.java
src/org/mxchange/jcontactsbusiness/exceptions/BusinessContactAlreadyAddedException.java

diff --git a/src/org/mxchange/jcontactsbusiness/BusinessBasicData.java b/src/org/mxchange/jcontactsbusiness/BusinessBasicData.java
new file mode 100644 (file)
index 0000000..b90ed81
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.List;
+import org.mxchange.jcontactsbusiness.branch.BranchOffice;
+import org.mxchange.jcontactsbusiness.employee.Employee;
+import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
+import org.mxchange.jcontactsbusiness.logo.BusinessLogo;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJI for business contact classes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface BusinessBasicData extends Serializable {
+
+       /**
+        * Getter for branches list
+        * <p>
+        * @return Branches list
+        */
+       List<BranchOffice> getBrancheOffices ();
+
+       /**
+        * Setter for branches list
+        * <p>
+        * @param branches Branches list
+        */
+       void setBrancheOffices (final List<BranchOffice> branches);
+
+       /**
+        * Getter for company contact person
+        * <p>
+        * @return Company contact person
+        */
+       Employee getCompanyContact ();
+
+       /**
+        * Setter for company contact person
+        * <p>
+        * @param companyContact Company contact person
+        */
+       void setCompanyContact (final Employee companyContact);
+
+       /**
+        * Getter for business contact id
+        * <p>
+        * @return Business contact id
+        */
+       Long getBusinessContactId ();
+
+       /**
+        * Setter for business contact id
+        * <p>
+        * @param businessContactId Business contact id
+        */
+       void setBusinessContactId (final Long businessContactId);
+
+       /**
+        * Getter for company founder
+        * <p>
+        * @return Company founder
+        */
+       Employee getCompanyFounder ();
+
+       /**
+        * Setter for company founder
+        * <p>
+        * @param companyFounder Company founder
+        */
+       void setCompanyFounder (final Employee companyFounder);
+
+       /**
+        * Getter for headquarters data
+        * <p>
+        * @return Headquarters data
+        */
+       HeadQuartersData getHeadQuartersData ();
+
+       /**
+        * Setter for headquarters data
+        * <p>
+        * @param headQuartersData Headquarters data
+        */
+       void setHeadQuartersData (final HeadQuartersData headQuartersData);
+
+       /**
+        * Getter for user owner instance
+        * <p>
+        * @return User owner instance
+        */
+       User getContactCompanyUserOwner ();
+
+       /**
+        * Setter for user owner instance
+        * <p>
+        * @param contactUserOwner User owner instance
+        */
+       void setContactCompanyUserOwner (final User contactUserOwner);
+
+       /**
+        * Getter for timestamp when this entry has been created
+        * <p>
+        * @return Timestamp when this entry has been created
+        */
+       Calendar getContactCreated ();
+
+       /**
+        * Setter for timestamp when this entry has been created
+        * <p>
+        * @param contactCreated Timestamp when this entry has been created
+        */
+       void setContactCreated (final Calendar contactCreated);
+
+       /**
+        * Getter for comments
+        * <p>
+        * @return Comments
+        */
+       String getCompanyComments ();
+
+       /**
+        * Setter for comments
+        * <p>
+        * @param companyComments Comments
+        */
+       void setCompanyComments (final String companyComments);
+
+       /**
+        * Getter for email address
+        * <p>
+        * @return Email address
+        */
+       String getCompanyEmailAddress ();
+
+       /**
+        * Setter for email address
+        * <p>
+        * @param companyEmailAddress Email address
+        */
+       void setCompanyEmailAddress (final String companyEmailAddress);
+
+       /**
+        * Getter for list of fax number
+        * <p>
+        * @return Fax numbers
+        */
+       DialableFaxNumber getCompanyFaxNumber ();
+
+       /**
+        * Setter for list of fax number
+        * <p>
+        * @param companyFaxNumber Fax numbers
+        */
+       void setCompanyFaxNumber (final DialableFaxNumber companyFaxNumber);
+
+       /**
+        * Getter for legal status
+        * <p>
+        * @return Legal status
+        */
+       String getCompanyLegalStatus ();
+
+       /**
+        * Setter for legal status
+        * <p>
+        * @param companyLegalStatus Legal status
+        */
+       void setCompanyLegalStatus (final String companyLegalStatus);
+
+       /**
+        * Getter for company logo
+        * <p>
+        * @return Company logo
+        */
+       BusinessLogo getCompanyLogo ();
+
+       /**
+        * Setter for company logo
+        * <p>
+        * @param companyLogo Company logo
+        */
+       void setCompanyLogo (final BusinessLogo companyLogo);
+
+       /**
+        * Getter for company name
+        * <p>
+        * @return Company name
+        */
+       String getCompanyName ();
+
+       /**
+        * Setter for company name
+        * <p>
+        * @param companyName Company name
+        */
+       void setCompanyName (final String companyName);
+
+       /**
+        * Getter for list of phone number
+        * <p>
+        * @return Phone numbers
+        */
+       DialableLandLineNumber getCompanyPhoneNumber ();
+
+       /**
+        * Setter for list of phone number
+        * <p>
+        * @param companyPhoneNumber Phone numbers
+        */
+       void setCompanyPhoneNumber (final DialableLandLineNumber companyPhoneNumber);
+
+       /**
+        * Getter for tax number
+        * <p>
+        * @return Tax number
+        */
+       String getCompanyTaxNumber ();
+
+       /**
+        * Setter for tax number
+        * <p>
+        * @param companyTaxNumber Tax number
+        */
+       void setCompanyTaxNumber (final String companyTaxNumber);
+
+       /**
+        * Getter for website URL
+        * <p>
+        * @return Website URL
+        */
+       String getCompanyWebsiteUrl ();
+
+       /**
+        * Setter for website URL
+        * <p>
+        * @param companyWebsiteUrl Website URL
+        */
+       void setCompanyWebsiteUrl (final String companyWebsiteUrl);
+
+       @Override
+       boolean equals (final Object object);
+
+       @Override
+       int hashCode ();
+}
diff --git a/src/org/mxchange/jcontactsbusiness/BusinessContact.java b/src/org/mxchange/jcontactsbusiness/BusinessContact.java
deleted file mode 100644 (file)
index 8fba8bb..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import java.util.List;
-import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.branch.BranchOffice;
-import org.mxchange.jcontactsbusiness.employee.Employee;
-import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A POJI for business contact classes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface BusinessContact extends Serializable {
-
-       /**
-        * Getter for basic company data
-        * <p>
-        * @return Basic company data
-        */
-       BusinessBasicData getBasicBusinessData ();
-
-       /**
-        * Setter for basic company data
-        * <p>
-        * @param basicBusinessData Basic company data
-        */
-       void setBasicBusinessData (final BusinessBasicData basicBusinessData);
-
-       /**
-        * Getter for branches list
-        * <p>
-        * @return Branches list
-        */
-       List<BranchOffice> getBrancheOffices ();
-
-       /**
-        * Setter for branches list
-        * <p>
-        * @param branches Branches list
-        */
-       void setBrancheOffices (final List<BranchOffice> branches);
-
-       /**
-        * Getter for company contact person
-        * <p>
-        * @return Company contact person
-        */
-       Employee getCompanyContact ();
-
-       /**
-        * Setter for company contact person
-        * <p>
-        * @param companyContact Company contact person
-        */
-       void setCompanyContact (final Employee companyContact);
-
-       /**
-        * Getter for business contact id
-        * <p>
-        * @return Business contact id
-        */
-       Long getBusinessContactId ();
-
-       /**
-        * Setter for business contact id
-        * <p>
-        * @param businessContactId Business contact id
-        */
-       void setBusinessContactId (final Long businessContactId);
-
-       /**
-        * Getter for company founder
-        * <p>
-        * @return Company founder
-        */
-       Employee getCompanyFounder ();
-
-       /**
-        * Setter for company founder
-        * <p>
-        * @param companyFounder Company founder
-        */
-       void setCompanyFounder (final Employee companyFounder);
-
-       /**
-        * Getter for headquarters data
-        * <p>
-        * @return Headquarters data
-        */
-       HeadQuartersData getHeadQuartersData ();
-
-       /**
-        * Setter for headquarters data
-        * <p>
-        * @param headQuartersData Headquarters data
-        */
-       void setHeadQuartersData (final HeadQuartersData headQuartersData);
-
-       /**
-        * Getter for user owner instance
-        * <p>
-        * @return User owner instance
-        */
-       User getContactCompanyUserOwner ();
-
-       /**
-        * Setter for user owner instance
-        * <p>
-        * @param contactUserOwner User owner instance
-        */
-       void setContactCompanyUserOwner (final User contactUserOwner);
-
-       /**
-        * Getter for timestamp when this entry has been created
-        * <p>
-        * @return Timestamp when this entry has been created
-        */
-       Calendar getContactCreated ();
-
-       /**
-        * Setter for timestamp when this entry has been created
-        * <p>
-        * @param contactCreated Timestamp when this entry has been created
-        */
-       void setContactCreated (final Calendar contactCreated);
-
-       @Override
-       boolean equals (final Object object);
-
-       @Override
-       int hashCode ();
-}
diff --git a/src/org/mxchange/jcontactsbusiness/CompanyBasicData.java b/src/org/mxchange/jcontactsbusiness/CompanyBasicData.java
new file mode 100644 (file)
index 0000000..e9eb0bf
--- /dev/null
@@ -0,0 +1,381 @@
+/*
+ * 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;
+
+import java.util.Calendar;
+import java.util.List;
+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.Lob;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcontactsbusiness.branch.BranchOffice;
+import org.mxchange.jcontactsbusiness.employee.CompanyEmployee;
+import org.mxchange.jcontactsbusiness.employee.Employee;
+import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData;
+import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
+import org.mxchange.jcontactsbusiness.logo.BusinessLogo;
+import org.mxchange.jcontactsbusiness.logo.CompanyLogo;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJO for business basic data
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "company_basic_data")
+@Table (name = "company_basic_data")
+@SuppressWarnings ("PersistenceUnitPresent")
+public class CompanyBasicData implements BusinessBasicData {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 470_375_172_748_691L;
+
+       /**
+        * Reference to company branch offices
+        */
+       @Transient
+       private List<BranchOffice> brancheOffices;
+
+       /**
+        * Id number
+        */
+       @Id
+       @Column (name = "business_contact_id", nullable = false, updatable = false)
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       private Long businessContactId;
+
+       /**
+        * Comments (any)
+        */
+       @Lob
+       @Column (name = "company_comments")
+       private String companyComments;
+
+       /**
+        * Reference to contact person
+        */
+       @JoinColumn (name = "company_contact_id")
+       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
+       private Employee companyContact;
+
+       /**
+        * Company's main email address (example: info@company.com)
+        */
+       @Column (name = "company_email_address", length = 100)
+       private String companyEmailAddress;
+
+       /**
+        * Company's main fax numbers: +ccxxxxxxxxxx
+        */
+       @JoinColumn (name = "company_fax_number_id")
+       @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
+       private DialableFaxNumber companyFaxNumber;
+
+       /**
+        * Reference to CEO "employee"
+        */
+       @JoinColumn (name = "company_founder_id")
+       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
+       private Employee companyFounder;
+
+       /**
+        * Legal status of company (example: "Inc.", "GmbH")
+        */
+       @Basic (optional = false)
+       @Column (name = "company_legal_status", nullable = false)
+       private String companyLegalStatus;
+
+       /**
+        * Id number of company logo
+        */
+       @JoinColumn (name = "company_logo_id")
+       @OneToOne (targetEntity = CompanyLogo.class, cascade = CascadeType.ALL)
+       private BusinessLogo companyLogo;
+
+       /**
+        * Company name
+        */
+       @Basic (optional = false)
+       @Column (name = "company_name", length = 100, nullable = false)
+       private String companyName;
+
+       /**
+        * Company's main phone number: +ccxxxxxxxxxx
+        */
+       @JoinColumn (name = "company_phone_number_id")
+       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+       private DialableLandLineNumber companyPhoneNumber;
+
+       /**
+        * Tax number
+        */
+       @Column (name = "company_tax_number", length = 30)
+       private String companyTaxNumber;
+
+       /**
+        * URL for company website
+        */
+       @Column (name = "company_website_url")
+       private String companyWebsiteUrl;
+
+       /**
+        * User owner instance
+        */
+       @JoinColumn (name = "company_owner_user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
+       private User contactCompanyUserOwner;
+
+       /**
+        * Timestamp when this entry has been created
+        */
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "company_entry_created", nullable = false, updatable = false)
+       private Calendar contactCreated;
+
+       /**
+        * Reference to headquarters data
+        */
+       @JoinColumn (name = "company_headquarters_data_id", nullable = false, updatable = false)
+       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL, optional = false)
+       private HeadQuartersData headQuartersData;
+
+       @Override
+       public boolean equals (final Object object) {
+               if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final BusinessBasicData other = (BusinessBasicData) object;
+
+               if (!Objects.equals(this.getBusinessContactId(), other.getBusinessContactId())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyName(), other.getCompanyName())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyLegalStatus(), other.getCompanyLegalStatus())) {
+                       return false;
+               } else if (!Objects.equals(this.getHeadQuartersData(), other.getHeadQuartersData())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyContact(), other.getCompanyContact())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyFounder(), other.getCompanyFounder())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BranchOffice> getBrancheOffices () {
+               return this.brancheOffices;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setBrancheOffices (final List<BranchOffice> brancheOffices) {
+               this.brancheOffices = brancheOffices;
+       }
+
+       @Override
+       public Long getBusinessContactId () {
+               return this.businessContactId;
+       }
+
+       @Override
+       public void setBusinessContactId (final Long businessContactId) {
+               this.businessContactId = businessContactId;
+       }
+
+       @Override
+       public String getCompanyComments () {
+               return this.companyComments;
+       }
+
+       @Override
+       public void setCompanyComments (final String companyComments) {
+               this.companyComments = companyComments;
+       }
+
+       @Override
+       public Employee getCompanyContact () {
+               return this.companyContact;
+       }
+
+       @Override
+       public void setCompanyContact (final Employee companyContact) {
+               this.companyContact = companyContact;
+       }
+
+       @Override
+       public String getCompanyEmailAddress () {
+               return this.companyEmailAddress;
+       }
+
+       @Override
+       public void setCompanyEmailAddress (final String companyEmailAddress) {
+               this.companyEmailAddress = companyEmailAddress;
+       }
+
+       @Override
+       public DialableFaxNumber getCompanyFaxNumber () {
+               return this.companyFaxNumber;
+       }
+
+       @Override
+       public void setCompanyFaxNumber (final DialableFaxNumber companyFaxNumber) {
+               this.companyFaxNumber = companyFaxNumber;
+       }
+
+       @Override
+       public Employee getCompanyFounder () {
+               return this.companyFounder;
+       }
+
+       @Override
+       public void setCompanyFounder (final Employee companyFounder) {
+               this.companyFounder = companyFounder;
+       }
+
+       @Override
+       public String getCompanyLegalStatus () {
+               return this.companyLegalStatus;
+       }
+
+       @Override
+       public void setCompanyLegalStatus (final String companyLegalStatus) {
+               this.companyLegalStatus = companyLegalStatus;
+       }
+
+       @Override
+       public BusinessLogo getCompanyLogo () {
+               return this.companyLogo;
+       }
+
+       @Override
+       public void setCompanyLogo (final BusinessLogo companyLogoId) {
+               this.companyLogo = companyLogoId;
+       }
+
+       @Override
+       public String getCompanyName () {
+               return this.companyName;
+       }
+
+       @Override
+       public void setCompanyName (final String companyName) {
+               this.companyName = companyName;
+       }
+
+       @Override
+       public DialableLandLineNumber getCompanyPhoneNumber () {
+               return this.companyPhoneNumber;
+       }
+
+       @Override
+       public void setCompanyPhoneNumber (final DialableLandLineNumber companyPhoneNumber) {
+               this.companyPhoneNumber = companyPhoneNumber;
+       }
+
+       @Override
+       public String getCompanyTaxNumber () {
+               return this.companyTaxNumber;
+       }
+
+       @Override
+       public void setCompanyTaxNumber (final String companyTaxNumber) {
+               this.companyTaxNumber = companyTaxNumber;
+       }
+
+       @Override
+       public String getCompanyWebsiteUrl () {
+               return this.companyWebsiteUrl;
+       }
+
+       @Override
+       public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
+               this.companyWebsiteUrl = companyWebsiteUrl;
+       }
+
+       @Override
+       public User getContactCompanyUserOwner () {
+               return this.contactCompanyUserOwner;
+       }
+
+       @Override
+       public void setContactCompanyUserOwner (final User contactCompanyUserOwner) {
+               this.contactCompanyUserOwner = contactCompanyUserOwner;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getContactCreated () {
+               return this.contactCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setContactCreated (final Calendar contactCreated) {
+               this.contactCreated = contactCreated;
+       }
+
+       @Override
+       public HeadQuartersData getHeadQuartersData () {
+               return this.headQuartersData;
+       }
+
+       @Override
+       public void setHeadQuartersData (final HeadQuartersData headQuartersData) {
+               this.headQuartersData = headQuartersData;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 3;
+
+               hash = 37 * hash + Objects.hashCode(this.getBusinessContactId());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyName());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyLegalStatus());
+               hash = 37 * hash + Objects.hashCode(this.getHeadQuartersData());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyContact());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyFounder());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/CompanyContact.java b/src/org/mxchange/jcontactsbusiness/CompanyContact.java
deleted file mode 100644 (file)
index 1c38b86..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * 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;
-
-import java.util.Calendar;
-import java.util.List;
-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.jcontactsbusiness.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData;
-import org.mxchange.jcontactsbusiness.branch.BranchOffice;
-import org.mxchange.jcontactsbusiness.employee.CompanyEmployee;
-import org.mxchange.jcontactsbusiness.employee.Employee;
-import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData;
-import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
-import org.mxchange.jusercore.model.user.LoginUser;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A POJO for business contacts
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_contacts")
-@Table (name = "company_contacts")
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyContact implements BusinessContact {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 470_375_172_748_691L;
-
-       /**
-        * Reference to basic data
-        */
-       @JoinColumn (name = "company_basic_data_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.ALL, optional = false)
-       private BusinessBasicData basicBusinessData;
-
-       /**
-        * Reference to company branch offices
-        */
-       @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
-        */
-       @JoinColumn (name = "company_contact_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
-       private Employee companyContact;
-
-       /**
-        * Reference to CEO "employee"
-        */
-       @JoinColumn (name = "company_founder_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
-       private Employee companyFounder;
-
-       /**
-        * User owner instance
-        */
-       @JoinColumn (name = "company_owner_user_id")
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
-       private User contactCompanyUserOwner;
-
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "company_entry_created", nullable = false, updatable = false)
-       private Calendar contactCreated;
-
-       /**
-        * Reference to headquarters data
-        */
-       @JoinColumn (name = "company_headquarters_data_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL, optional = false)
-       private HeadQuartersData headQuartersData;
-
-       @Override
-       public boolean equals (final Object object) {
-               if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final BusinessContact other = (BusinessContact) object;
-
-               if (!Objects.equals(this.getBusinessContactId(), other.getBusinessContactId())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyContact(), other.getCompanyContact())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyFounder(), other.getCompanyFounder())) {
-                       return false;
-               } else if (!Objects.equals(this.getBasicBusinessData(), other.getBasicBusinessData())) {
-                       return false;
-               } else if (!Objects.equals(this.getHeadQuartersData(), other.getHeadQuartersData())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       public BusinessBasicData getBasicBusinessData () {
-               return this.basicBusinessData;
-       }
-
-       @Override
-       public void setBasicBusinessData (final BusinessBasicData basicBusinessData) {
-               this.basicBusinessData = basicBusinessData;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BranchOffice> getBrancheOffices () {
-               return this.brancheOffices;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setBrancheOffices (final List<BranchOffice> brancheOffices) {
-               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;
-       }
-
-       @Override
-       public void setCompanyContact (final Employee companyContact) {
-               this.companyContact = companyContact;
-       }
-
-       @Override
-       public Employee getCompanyFounder () {
-               return this.companyFounder;
-       }
-
-       @Override
-       public void setCompanyFounder (final Employee companyFounder) {
-               this.companyFounder = companyFounder;
-       }
-
-       @Override
-       public User getContactCompanyUserOwner () {
-               return this.contactCompanyUserOwner;
-       }
-
-       @Override
-       public void setContactCompanyUserOwner (final User contactCompanyUserOwner) {
-               this.contactCompanyUserOwner = contactCompanyUserOwner;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Calendar getContactCreated () {
-               return this.contactCreated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setContactCreated (final Calendar contactCreated) {
-               this.contactCreated = contactCreated;
-       }
-
-       @Override
-       public HeadQuartersData getHeadQuartersData () {
-               return this.headQuartersData;
-       }
-
-       @Override
-       public void setHeadQuartersData (final HeadQuartersData headQuartersData) {
-               this.headQuartersData = headQuartersData;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 3;
-
-               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());
-               hash = 37 * hash + Objects.hashCode(this.getHeadQuartersData());
-
-               return hash;
-       }
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/BusinessBasicData.java b/src/org/mxchange/jcontactsbusiness/basicdata/BusinessBasicData.java
deleted file mode 100644 (file)
index 29a041a..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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.basicdata;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import org.mxchange.jcontactsbusiness.logo.BusinessLogo;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
-
-/**
- * A POJI for basic business data
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface BusinessBasicData extends Serializable {
-
-       /**
-        * Getter for id number
-        * <p>
-        * @return Id number
-        */
-       Long getCompanyBasicId ();
-
-       /**
-        * Setter for id number
-        * <p>
-        * @param companyBasicId Id number
-        */
-       void setCompanyBasicId (final Long companyBasicId);
-
-       /**
-        * Getter for comments
-        * <p>
-        * @return Comments
-        */
-       String getCompanyComments ();
-
-       /**
-        * Setter for comments
-        * <p>
-        * @param companyComments Comments
-        */
-       void setCompanyComments (final String companyComments);
-
-       /**
-        * Getter for email address
-        * <p>
-        * @return Email address
-        */
-       String getCompanyEmailAddress ();
-
-       /**
-        * Setter for email address
-        * <p>
-        * @param companyEmailAddress Email address
-        */
-       void setCompanyEmailAddress (final String companyEmailAddress);
-
-       /**
-        * Getter for list of fax number
-        * <p>
-        * @return Fax numbers
-        */
-       DialableFaxNumber getCompanyFaxNumber ();
-
-       /**
-        * Setter for list of fax number
-        * <p>
-        * @param companyFaxNumber Fax numbers
-        */
-       void setCompanyFaxNumber (final DialableFaxNumber companyFaxNumber);
-
-       /**
-        * Getter for legal status
-        * <p>
-        * @return Legal status
-        */
-       String getCompanyLegalStatus ();
-
-       /**
-        * Setter for legal status
-        * <p>
-        * @param companyLegalStatus Legal status
-        */
-       void setCompanyLegalStatus (final String companyLegalStatus);
-
-       /**
-        * Getter for company logo
-        * <p>
-        * @return Company logo
-        */
-       BusinessLogo getCompanyLogo ();
-
-       /**
-        * Setter for company logo
-        * <p>
-        * @param companyLogo Company logo
-        */
-       void setCompanyLogo (final BusinessLogo companyLogo);
-
-       /**
-        * Getter for company name
-        * <p>
-        * @return Company name
-        */
-       String getCompanyName ();
-
-       /**
-        * Setter for company name
-        * <p>
-        * @param companyName Company name
-        */
-       void setCompanyName (final String companyName);
-
-       /**
-        * Getter for list of phone number
-        * <p>
-        * @return Phone numbers
-        */
-       DialableLandLineNumber getCompanyPhoneNumber ();
-
-       /**
-        * Setter for list of phone number
-        * <p>
-        * @param companyPhoneNumber Phone numbers
-        */
-       void setCompanyPhoneNumber (final DialableLandLineNumber companyPhoneNumber);
-
-       /**
-        * Getter for tax number
-        * <p>
-        * @return Tax number
-        */
-       String getCompanyTaxNumber ();
-
-       /**
-        * Setter for tax number
-        * <p>
-        * @param companyTaxNumber Tax number
-        */
-       void setCompanyTaxNumber (final String companyTaxNumber);
-
-       /**
-        * Getter for website URL
-        * <p>
-        * @return Website URL
-        */
-       String getCompanyWebsiteUrl ();
-
-       /**
-        * Setter for website URL
-        * <p>
-        * @param companyWebsiteUrl Website URL
-        */
-       void setCompanyWebsiteUrl (final String companyWebsiteUrl);
-
-       /**
-        * Getter for timestamp when this entry has been created
-        * <p>
-        * @return Timestamp when this entry has been created
-        */
-       Calendar getBasicCreated ();
-
-       /**
-        * Setter for timestamp when this entry has been created
-        * <p>
-        * @param basicCreated Timestamp when this entry has been created
-        */
-       void setBasicCreated (final Calendar basicCreated);
-
-       @Override
-       boolean equals (final Object object);
-
-       @Override
-       int hashCode ();
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java b/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java
deleted file mode 100644 (file)
index 8918906..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * 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.basicdata;
-
-import java.util.Calendar;
-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.Lob;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcontactsbusiness.logo.BusinessLogo;
-import org.mxchange.jcontactsbusiness.logo.CompanyLogo;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
-
-/**
- * A POJO for basic company data
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_basic_data")
-@Table (name = "company_basic_data")
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyBasicData implements BusinessBasicData {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 486_895_878_178_761L;
-
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "company_entry_created", nullable = false, updatable = false)
-       private Calendar basicCreated;
-
-       /**
-        * Id number
-        */
-       @Id
-       @Column (name = "company_basic_id", nullable = false, updatable = false)
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       private Long companyBasicId;
-
-       /**
-        * Comments (any)
-        */
-       @Lob
-       @Column (name = "company_comments")
-       private String companyComments;
-
-       /**
-        * Company's main email address (example: info@company.com)
-        */
-       @Column (name = "company_email_address", length = 100)
-       private String companyEmailAddress;
-
-       /**
-        * Company's main fax numbers: +ccxxxxxxxxxx
-        */
-       @JoinColumn (name = "company_fax_number_id")
-       @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
-       private DialableFaxNumber companyFaxNumber;
-
-       /**
-        * Legal status of company (example: "Inc.", "GmbH")
-        */
-       @Basic (optional = false)
-       @Column (name = "company_legal_status", nullable = false)
-       private String companyLegalStatus;
-
-       /**
-        * Id number of company logo
-        */
-       @JoinColumn (name = "company_logo_id")
-       @OneToOne (targetEntity = CompanyLogo.class, cascade = CascadeType.ALL)
-       private BusinessLogo companyLogo;
-
-       /**
-        * Company name
-        */
-       @Basic (optional = false)
-       @Column (name = "company_name", length = 100, nullable = false)
-       private String companyName;
-
-       /**
-        * Company's main phone number: +ccxxxxxxxxxx
-        */
-       @JoinColumn (name = "company_phone_number_id")
-       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
-       private DialableLandLineNumber companyPhoneNumber;
-
-       /**
-        * Tax number
-        */
-       @Column (name = "company_tax_number", length = 30)
-       private String companyTaxNumber;
-
-       /**
-        * URL for company website
-        */
-       @Column (name = "company_website_url")
-       private String companyWebsiteUrl;
-
-       @Override
-       public boolean equals (final Object object) {
-               if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final BusinessBasicData other = (BusinessBasicData) object;
-
-               if (!Objects.equals(this.getCompanyBasicId(), other.getCompanyBasicId())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyLegalStatus(), other.getCompanyLegalStatus())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyName(), other.getCompanyName())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyTaxNumber(), other.getCompanyTaxNumber())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Calendar getBasicCreated () {
-               return this.basicCreated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setBasicCreated (final Calendar basicCreated) {
-               this.basicCreated = basicCreated;
-       }
-
-       @Override
-       public Long getCompanyBasicId () {
-               return this.companyBasicId;
-       }
-
-       @Override
-       public void setCompanyBasicId (final Long companyBasicId) {
-               this.companyBasicId = companyBasicId;
-       }
-
-       @Override
-       public String getCompanyComments () {
-               return this.companyComments;
-       }
-
-       @Override
-       public void setCompanyComments (final String companyComments) {
-               this.companyComments = companyComments;
-       }
-
-       @Override
-       public String getCompanyEmailAddress () {
-               return this.companyEmailAddress;
-       }
-
-       @Override
-       public void setCompanyEmailAddress (final String companyEmailAddress) {
-               this.companyEmailAddress = companyEmailAddress;
-       }
-
-       @Override
-       public DialableFaxNumber getCompanyFaxNumber () {
-               return this.companyFaxNumber;
-       }
-
-       @Override
-       public void setCompanyFaxNumber (final DialableFaxNumber companyFaxNumber) {
-               this.companyFaxNumber = companyFaxNumber;
-       }
-
-       @Override
-       public String getCompanyLegalStatus () {
-               return this.companyLegalStatus;
-       }
-
-       @Override
-       public void setCompanyLegalStatus (final String companyLegalStatus) {
-               this.companyLegalStatus = companyLegalStatus;
-       }
-
-       @Override
-       public BusinessLogo getCompanyLogo () {
-               return this.companyLogo;
-       }
-
-       @Override
-       public void setCompanyLogo (final BusinessLogo companyLogoId) {
-               this.companyLogo = companyLogoId;
-       }
-
-       @Override
-       public String getCompanyName () {
-               return this.companyName;
-       }
-
-       @Override
-       public void setCompanyName (final String companyName) {
-               this.companyName = companyName;
-       }
-
-       @Override
-       public DialableLandLineNumber getCompanyPhoneNumber () {
-               return this.companyPhoneNumber;
-       }
-
-       @Override
-       public void setCompanyPhoneNumber (final DialableLandLineNumber companyPhoneNumber) {
-               this.companyPhoneNumber = companyPhoneNumber;
-       }
-
-       @Override
-       public String getCompanyTaxNumber () {
-               return this.companyTaxNumber;
-       }
-
-       @Override
-       public void setCompanyTaxNumber (final String companyTaxNumber) {
-               this.companyTaxNumber = companyTaxNumber;
-       }
-
-       @Override
-       public String getCompanyWebsiteUrl () {
-               return this.companyWebsiteUrl;
-       }
-
-       @Override
-       public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
-               this.companyWebsiteUrl = companyWebsiteUrl;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 5;
-
-               hash = 53 * hash + Objects.hashCode(this.getCompanyBasicId());
-               hash = 53 * hash + Objects.hashCode(this.getCompanyLegalStatus());
-               hash = 53 * hash + Objects.hashCode(this.getCompanyName());
-               hash = 53 * hash + Objects.hashCode(this.getCompanyTaxNumber());
-
-               return hash;
-       }
-
-}
index 7e445c7b755e2d8085f1c11273228dad17458ad7..3616fc26cb2fc584ff930c7d8d4190c9c142a7f8 100644 (file)
@@ -18,11 +18,11 @@ package org.mxchange.jcontactsbusiness.branch;
 
 import java.io.Serializable;
 import java.util.Calendar;
-import org.mxchange.jcontactsbusiness.BusinessContact;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
 
 /**
  * A POJI for branch offices
@@ -190,14 +190,14 @@ public interface BranchOffice extends Serializable {
         * <p>
         * @return Branch office's company
         */
-       BusinessContact getBranchCompanyContact ();
+       BusinessBasicData getBranchCompanyContact ();
 
        /**
         * Setter for branch office's company
         * <p>
         * @param branchCompanyContact Branch office's company
         */
-       void setBranchCompanyContact (final BusinessContact branchCompanyContact);
+       void setBranchCompanyContact (final BusinessBasicData branchCompanyContact);
 
        /**
         * Getter for user owner instance
index 0a440367f8041be8856311157c047cf43f925d4a..b52338f7dcfcac390da890e43f064e6877cd2c4f 100644 (file)
@@ -31,8 +31,8 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
-import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jcontactsbusiness.CompanyContact;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.CompanyBasicData;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@@ -69,8 +69,8 @@ public class CompanyBranchOffice implements BranchOffice {
         * Company that has this branch office
         */
        @JoinColumn (name = "branch_company_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyContact.class, optional = false, cascade = CascadeType.ALL)
-       private BusinessContact branchCompanyContact;
+       @OneToOne (targetEntity = CompanyBasicData.class, optional = false, cascade = CascadeType.ALL)
+       private BusinessBasicData branchCompanyContact;
 
        /**
         * Branch office's country code
@@ -144,8 +144,8 @@ public class CompanyBranchOffice implements BranchOffice {
        /**
         * User owner instance
         */
-       @JoinColumn (name = "branch_user_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+       @JoinColumn (name = "branch_user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
        private User branchUserOwner;
 
        /**
@@ -197,12 +197,12 @@ public class CompanyBranchOffice implements BranchOffice {
        }
 
        @Override
-       public BusinessContact getBranchCompanyContact () {
+       public BusinessBasicData getBranchCompanyContact () {
                return this.branchCompanyContact;
        }
 
        @Override
-       public void setBranchCompanyContact (final BusinessContact branchCompanyContact) {
+       public void setBranchCompanyContact (final BusinessBasicData branchCompanyContact) {
                this.branchCompanyContact = branchCompanyContact;
        }
 
index dd64d2e04d77eb3f536435238c02409ae7f218e5..6e567056b4521406df894a681b312249119580c5 100644 (file)
@@ -32,8 +32,7 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
-import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jcontactsbusiness.CompanyContact;
+import org.mxchange.jcontactsbusiness.CompanyBasicData;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice;
 import org.mxchange.jcontactsbusiness.employee.CompanyEmployee;
@@ -42,6 +41,7 @@ import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData;
 import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
 
 /**
  * A POJO for company departments
@@ -77,8 +77,8 @@ public class CompanyDepartment implements Department {
         * Connection to company contact
         */
        @JoinColumn (name = "department_company_id", nullable = false, updatable = false)
-       @ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false)
-       private BusinessContact departmentCompany;
+       @ManyToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.ALL, optional = false)
+       private BusinessBasicData departmentCompany;
 
        /**
         * Timestamp when this entry has been created
@@ -159,12 +159,12 @@ public class CompanyDepartment implements Department {
        }
 
        @Override
-       public BusinessContact getDepartmentCompany () {
+       public BusinessBasicData getDepartmentCompany () {
                return this.departmentCompany;
        }
 
        @Override
-       public void setDepartmentCompany (final BusinessContact departmentCompany) {
+       public void setDepartmentCompany (final BusinessBasicData departmentCompany) {
                this.departmentCompany = departmentCompany;
        }
 
index 6f5be397ca31b4cac913a20451b9b23196cac6bd..08de410a76be836e3d70612485a42df7de42f2d9 100644 (file)
@@ -18,11 +18,11 @@ package org.mxchange.jcontactsbusiness.department;
 
 import java.io.Serializable;
 import java.util.Calendar;
-import org.mxchange.jcontactsbusiness.BusinessContact;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.employee.Employee;
 import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
 
 /**
  * A POJI for company departments
@@ -36,14 +36,14 @@ public interface Department extends Serializable {
         * <p>
         * @return Connection to company contact
         */
-       BusinessContact getDepartmentCompany ();
+       BusinessBasicData getDepartmentCompany ();
 
        /**
         * Setter for connection to company contact
         * <p>
         * @param departmentCompany Connection to company contact
         */
-       void setDepartmentCompany (final BusinessContact departmentCompany);
+       void setDepartmentCompany (final BusinessBasicData departmentCompany);
 
        /**
         * Getter for connection to company headquarters
index 76fb0e2eb98eb576c5f90e465cec5b9b7e7314a2..c16ab48862d7ab279414a217207ee48f94f2353a 100644 (file)
@@ -33,8 +33,7 @@ import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.UserContact;
-import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jcontactsbusiness.CompanyContact;
+import org.mxchange.jcontactsbusiness.CompanyBasicData;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice;
 import org.mxchange.jcontactsbusiness.department.CompanyDepartment;
@@ -47,6 +46,7 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
 
 /**
  * A POJO for company employees (including CEO)
@@ -75,8 +75,8 @@ public class CompanyEmployee implements Employee {
         * Company the employee is working at
         */
        @JoinColumn (name = "employee_company_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false)
-       private BusinessContact employeeCompany;
+       @OneToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.ALL, optional = false)
+       private BusinessBasicData employeeCompany;
 
        /**
         * Timestamp when this entry has been created
@@ -188,12 +188,12 @@ public class CompanyEmployee implements Employee {
        }
 
        @Override
-       public BusinessContact getEmployeeCompany () {
+       public BusinessBasicData getEmployeeCompany () {
                return this.employeeCompany;
        }
 
        @Override
-       public void setEmployeeCompany (final BusinessContact employeeCompany) {
+       public void setEmployeeCompany (final BusinessBasicData employeeCompany) {
                this.employeeCompany = employeeCompany;
        }
 
index 69de2be4f0cca536aae73bd15cd08bad38c25bf4..a7e9b0b10523c64ce92c16dd8d03ad827d2374f7 100644 (file)
@@ -19,13 +19,13 @@ package org.mxchange.jcontactsbusiness.employee;
 import java.io.Serializable;
 import java.util.Calendar;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontactsbusiness.BusinessContact;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.department.Department;
 import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
 import org.mxchange.jcontactsbusiness.jobposition.JobPosition;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
 
 /**
  * A POJI for employees
@@ -53,14 +53,14 @@ public interface Employee extends Serializable {
         * <p>
         * @return Company instance
         */
-       BusinessContact getEmployeeCompany ();
+       BusinessBasicData getEmployeeCompany ();
 
        /**
         * Setter for employee's company
         * <p>
         * @param employeeCompany Company instance
         */
-       void setEmployeeCompany (final BusinessContact employeeCompany);
+       void setEmployeeCompany (final BusinessBasicData employeeCompany);
 
        /**
         * Getter for employee's department
index 82937c7ecf2830ba282baf29b680aeeccf3b541a..620243e8c27ca88cfddd5f044016c187905fa637 100644 (file)
 package org.mxchange.jcontactsbusiness.exceptions;
 
 import java.text.MessageFormat;
-import org.mxchange.jcontactsbusiness.BusinessContact;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
 
 /**
- * Thrown if the given BusinessContact instance is already added
+ * Thrown if the given BusinessBasicData instance is already added
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
@@ -36,7 +36,7 @@ public class BusinessContactAlreadyAddedException extends Exception {
         * <p>
         * @param businessContact Business contact that is already added
         */
-       public BusinessContactAlreadyAddedException (final BusinessContact businessContact) {
+       public BusinessContactAlreadyAddedException (final BusinessBasicData businessContact) {
                super(MessageFormat.format("Business contact with businessContactId={0} not found.", businessContact.getBusinessContactId())); //NOI18N
        }