]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 16 Oct 2017 18:28:23 +0000 (20:28 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 17 Oct 2017 20:41:21 +0000 (22:41 +0200)
- no other employees than company/business employees will be there ...
- renamed Employee interface to a much nicer Employable name
- renamed CompanyDepartment -> BusinessDepartment as there will be other kinds
  of departments (e.g. fire/police)
- renamed more company -> business, but not all

Signed-off-by: Roland Häder <roland@mxchange.org>
23 files changed:
src/org/mxchange/jcontactsbusiness/events/basicdata/added/AdminAddedBusinessBasicDataEvent.java
src/org/mxchange/jcontactsbusiness/events/basicdata/added/ObservableAdminAddedBusinessBasicDataEvent.java
src/org/mxchange/jcontactsbusiness/events/employee/added/EmployeeAddedEvent.java
src/org/mxchange/jcontactsbusiness/events/employee/added/ObservableEmployeeAddedEvent.java
src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicCompanyDataAlreadyAddedException.java [deleted file]
src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicCompanyDataNotFoundException.java [deleted file]
src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicDataAlreadyAddedException.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicDataNotFoundException.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/exceptions/employee/CompanyEmployeeNotFoundException.java [deleted file]
src/org/mxchange/jcontactsbusiness/exceptions/employee/EmployeeNotFoundException.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/model/basicdata/BasicData.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/model/basicdata/BusinessBasicData.java
src/org/mxchange/jcontactsbusiness/model/basicdata/CompanyBasicData.java [deleted file]
src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOffice.java
src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/model/branchoffice/CompanyBranchOffice.java [deleted file]
src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/model/department/CompanyDepartment.java [deleted file]
src/org/mxchange/jcontactsbusiness/model/department/Department.java
src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/model/employee/CompanyEmployee.java [deleted file]
src/org/mxchange/jcontactsbusiness/model/employee/Employable.java [new file with mode: 0644]
src/org/mxchange/jcontactsbusiness/model/employee/Employee.java [deleted file]

index 44debeb360a7a3e1089a79edec26e31e96b4b2ac..f60849733f6b399e76a10e0d386d55736704bd7b 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontactsbusiness.events.basicdata.added;
 
 import java.text.MessageFormat;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An event being thrown when new basic business data has been added.
@@ -35,14 +35,14 @@ public class AdminAddedBusinessBasicDataEvent implements ObservableAdminAddedBus
         * Basic data instance just being created. It must bear aside company name
         * also a primary key.
         */
-       private final BusinessBasicData basicData;
+       private final BasicData basicData;
 
        /**
         * Constructor with basic data
         * <p>
         * @param basicData Basic data with at least company name and primary key
         */
-       public AdminAddedBusinessBasicDataEvent (final BusinessBasicData basicData) {
+       public AdminAddedBusinessBasicDataEvent (final BasicData basicData) {
                // Is company name and primary key set?
                if (null == basicData) {
                        // Throw NPE
@@ -66,7 +66,7 @@ public class AdminAddedBusinessBasicDataEvent implements ObservableAdminAddedBus
        }
 
        @Override
-       public BusinessBasicData getBasicData () {
+       public BasicData getBasicData () {
                return this.basicData;
        }
 
index b8051d618cb8ef6dfe31c357d0e700dc19b3deb4..67dc3f6fa4d38021497ad8c479d4a6bb524aab04 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontactsbusiness.events.basicdata.added;
 
 import java.io.Serializable;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An interface for events being fired when new basic business data has been
@@ -32,6 +32,6 @@ public interface ObservableAdminAddedBusinessBasicDataEvent extends Serializable
         * <p>
         * @return Basic business data entity
         */
-       BusinessBasicData getBasicData ();
+       BasicData getBasicData ();
 
 }
index 483ee5177ebfff62f83425db079db1d53d1f8e86..6acb434bbef6b4160edd54c5967558a2afa07a8a 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontactsbusiness.events.employee.added;
 
 import java.text.MessageFormat;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
 
 /**
  * An event being fired when a employee has been added
@@ -34,7 +34,7 @@ public class EmployeeAddedEvent implements ObservableEmployeeAddedEvent {
        /**
         * Branch office instance being added
         */
-       private final Employee employee;
+       private final Employable employee;
 
        /**
         * Constructor with employee instance
@@ -42,7 +42,7 @@ public class EmployeeAddedEvent implements ObservableEmployeeAddedEvent {
         * @param employee Branch office instance
         * @throws NullPointerException If the parameter is null
         */
-       public EmployeeAddedEvent (final Employee employee) {
+       public EmployeeAddedEvent (final Employable employee) {
                // Check parameter
                if (null == employee) {
                        // Throw NPE
@@ -60,7 +60,7 @@ public class EmployeeAddedEvent implements ObservableEmployeeAddedEvent {
        }
 
        @Override
-       public Employee getEmployee () {
+       public Employable getEmployee () {
                return this.employee;
        }
 
index d7bac1a4364e0d9fff15ed16c4b8db670bd5f24c..395b683e0b26fb95b08c1ab8a03b7024997668c3 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontactsbusiness.events.employee.added;
 
 import java.io.Serializable;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
 
 /**
  * An interface for events being triggered when a employee has been added.
@@ -29,8 +29,8 @@ public interface ObservableEmployeeAddedEvent extends Serializable {
        /**
         * Getter for employee instance
         * <p>
-        * @return Employee instance
+        * @return Employable instance
         */
-       Employee getEmployee ();
+       Employable getEmployee ();
 
 }
diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicCompanyDataAlreadyAddedException.java b/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicCompanyDataAlreadyAddedException.java
deleted file mode 100644 (file)
index f489c7f..0000000
+++ /dev/null
@@ -1,50 +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.exceptions.basicdata;
-
-import java.text.MessageFormat;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-
-/**
- * Thrown if the given BusinessBasicData instance is already added
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class BasicCompanyDataAlreadyAddedException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 75_844_851_467L;
-
-       /**
-        * Constructor with a basic data instance
-        * <p>
-        * @param businessContact Business contact that is already added
-        */
-       public BasicCompanyDataAlreadyAddedException (final BusinessBasicData businessContact) {
-               super(MessageFormat.format("Business contact with comanyName={0} already added.", businessContact.getCompanyName())); //NOI18N
-       }
-
-       /**
-        * Default constructor, may be used if no contact instance is available
-        */
-       public BasicCompanyDataAlreadyAddedException () {
-               super("Business contact already added"); //NOI18N
-       }
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicCompanyDataNotFoundException.java b/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicCompanyDataNotFoundException.java
deleted file mode 100644 (file)
index 8f214c9..0000000
+++ /dev/null
@@ -1,65 +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.exceptions.basicdata;
-
-import java.text.MessageFormat;
-
-/**
- * An exception thrown when basic company data (entity) has not found.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class BasicCompanyDataNotFoundException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 23_759_801_876_416_569L;
-
-       /**
-        * Constructor with business contact id
-        * <p>
-        * @param businessContactId Business contact id
-        */
-       public BasicCompanyDataNotFoundException (final Long businessContactId) {
-               // Call super constructor with message and cause
-               super(MessageFormat.format("Business contact with id {0} was not found.", businessContactId)); //NOI18N
-       }
-
-       /**
-        * Constructor with business contact id and causing exception
-        * <p>
-        * @param businessContactId Business contact id
-        * @param cause             Causing exception
-        */
-       public BasicCompanyDataNotFoundException (final Long businessContactId, final Throwable cause) {
-               // Call super constructor with message and cause
-               super(MessageFormat.format("Business contact with id {0} was not found.", businessContactId), cause); //NOI18N
-       }
-
-       /**
-        * Constructor with email address and causing exception
-        * <p>
-        * @param emailAddress Email address
-        * @param cause        Causing exception
-        */
-       public BasicCompanyDataNotFoundException (final String emailAddress, final Throwable cause) {
-               // Call super constructor with message and cause
-               super(MessageFormat.format("Business contact with email address {0} was not found.", emailAddress), cause); //NOI18N
-       }
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicDataAlreadyAddedException.java b/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicDataAlreadyAddedException.java
new file mode 100644 (file)
index 0000000..9dc55b1
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.exceptions.basicdata;
+
+import java.text.MessageFormat;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * Thrown if the given BasicData instance is already added
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class BasicDataAlreadyAddedException extends Exception {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 75_844_851_467L;
+
+       /**
+        * Constructor with a basic data instance
+        * <p>
+        * @param businessContact Business contact that is already added
+        */
+       public BasicDataAlreadyAddedException (final BasicData businessContact) {
+               super(MessageFormat.format("Business contact with comanyName={0} already added.", businessContact.getCompanyName())); //NOI18N
+       }
+
+       /**
+        * Default constructor, may be used if no contact instance is available
+        */
+       public BasicDataAlreadyAddedException () {
+               super("Business contact already added"); //NOI18N
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicDataNotFoundException.java b/src/org/mxchange/jcontactsbusiness/exceptions/basicdata/BasicDataNotFoundException.java
new file mode 100644 (file)
index 0000000..2b70164
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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.exceptions.basicdata;
+
+import java.text.MessageFormat;
+
+/**
+ * An exception thrown when basic company data (entity) has not found.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class BasicDataNotFoundException extends Exception {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 23_759_801_876_416_569L;
+
+       /**
+        * Constructor with business contact id
+        * <p>
+        * @param businessContactId Business contact id
+        */
+       public BasicDataNotFoundException (final Long businessContactId) {
+               // Call super constructor with message and cause
+               super(MessageFormat.format("Business contact with id {0} was not found.", businessContactId)); //NOI18N
+       }
+
+       /**
+        * Constructor with business contact id and causing exception
+        * <p>
+        * @param businessContactId Business contact id
+        * @param cause             Causing exception
+        */
+       public BasicDataNotFoundException (final Long businessContactId, final Throwable cause) {
+               // Call super constructor with message and cause
+               super(MessageFormat.format("Business contact with id {0} was not found.", businessContactId), cause); //NOI18N
+       }
+
+       /**
+        * Constructor with email address and causing exception
+        * <p>
+        * @param emailAddress Email address
+        * @param cause        Causing exception
+        */
+       public BasicDataNotFoundException (final String emailAddress, final Throwable cause) {
+               // Call super constructor with message and cause
+               super(MessageFormat.format("Business contact with email address {0} was not found.", emailAddress), cause); //NOI18N
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/employee/CompanyEmployeeNotFoundException.java b/src/org/mxchange/jcontactsbusiness/exceptions/employee/CompanyEmployeeNotFoundException.java
deleted file mode 100644 (file)
index 21ee750..0000000
+++ /dev/null
@@ -1,65 +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.exceptions.employee;
-
-import java.text.MessageFormat;
-
-/**
- * An exception thrown when a company employee (entity) has not found.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CompanyEmployeeNotFoundException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 23_759_801_876_416_571L;
-
-       /**
-        * Constructor with company employee id
-        * <p>
-        * @param employeeId Company employee id
-        */
-       public CompanyEmployeeNotFoundException (final Long employeeId) {
-               // Call super constructor with message and cause
-               super(MessageFormat.format("Company employee with id {0} was not found.", employeeId)); //NOI18N
-       }
-
-       /**
-        * Constructor with company employee id and causing exception
-        * <p>
-        * @param employeeId Company employee id
-        * @param cause      Causing exception
-        */
-       public CompanyEmployeeNotFoundException (final Long employeeId, final Throwable cause) {
-               // Call super constructor with message and cause
-               super(MessageFormat.format("Company employee with id {0} was not found.", employeeId), cause); //NOI18N
-       }
-
-       /**
-        * Constructor with email address and causing exception
-        * <p>
-        * @param emailAddress Email address
-        * @param cause        Causing exception
-        */
-       public CompanyEmployeeNotFoundException (final String emailAddress, final Throwable cause) {
-               // Call super constructor with message and cause
-               super(MessageFormat.format("Company employee with email address {0} was not found.", emailAddress), cause); //NOI18N
-       }
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/exceptions/employee/EmployeeNotFoundException.java b/src/org/mxchange/jcontactsbusiness/exceptions/employee/EmployeeNotFoundException.java
new file mode 100644 (file)
index 0000000..64b2b97
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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.exceptions.employee;
+
+import java.text.MessageFormat;
+
+/**
+ * An exception thrown when a employee (entity) has not found.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class EmployeeNotFoundException extends Exception {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 23_759_801_876_416_571L;
+
+       /**
+        * Constructor with employee id
+        * <p>
+        * @param employeeId Employee id
+        */
+       public EmployeeNotFoundException (final Long employeeId) {
+               // Call super constructor with message and cause
+               super(MessageFormat.format("Employee with id {0} was not found.", employeeId)); //NOI18N
+       }
+
+       /**
+        * Constructor with company employee id and causing exception
+        * <p>
+        * @param employeeId Company employee id
+        * @param cause      Causing exception
+        */
+       public EmployeeNotFoundException (final Long employeeId, final Throwable cause) {
+               // Call super constructor with message and cause
+               super(MessageFormat.format("Employee with id {0} was not found.", employeeId), cause); //NOI18N
+       }
+
+       /**
+        * Constructor with email address and causing exception
+        * <p>
+        * @param emailAddress Email address
+        * @param cause        Causing exception
+        */
+       public EmployeeNotFoundException (final String emailAddress, final Throwable cause) {
+               // Call super constructor with message and cause
+               super(MessageFormat.format("Employee with email address {0} was not found.", emailAddress), cause); //NOI18N
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/model/basicdata/BasicData.java b/src/org/mxchange/jcontactsbusiness/model/basicdata/BasicData.java
new file mode 100644 (file)
index 0000000..6eef651
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * 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.basicdata;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+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;
+
+/**
+ * A POJI for business contact classes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface BasicData 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
+        */
+       Employable getCompanyContactEmployee ();
+
+       /**
+        * Setter for company contact person
+        * <p>
+        * @param companyContact Company contact person
+        */
+       void setCompanyContactEmployee (final Employable companyContact);
+
+       /**
+        * Getter for business contact id
+        * <p>
+        * @return Business contact id
+        */
+       Long getBasicDataId ();
+
+       /**
+        * Setter for business contact id
+        * <p>
+        * @param businessContactId Business contact id
+        */
+       void setBasicDataId (final Long businessContactId);
+
+       /**
+        * Getter for company founder
+        * <p>
+        * @return Company founder
+        */
+       Employable getCompanyFounder ();
+
+       /**
+        * Setter for company founder
+        * <p>
+        * @param companyFounder Company founder
+        */
+       void setCompanyFounder (final Employable companyFounder);
+
+       /**
+        * Getter for headquarters data
+        * <p>
+        * @return Headquarters data
+        */
+       HeadquartersData getCompanyHeadQuartersData ();
+
+       /**
+        * Setter for headquarters data
+        * <p>
+        * @param headQuartersData Headquarters data
+        */
+       void setCompanyHeadQuartersData (final HeadquartersData headQuartersData);
+
+       /**
+        * Getter for user owner instance
+        * <p>
+        * @return User owner instance
+        */
+       User getCompanyUserOwner ();
+
+       /**
+        * Setter for user owner instance
+        * <p>
+        * @param contactUserOwner User owner instance
+        */
+       void setCompanyUserOwner (final User contactUserOwner);
+
+       /**
+        * Getter for timestamp when this entry has been created
+        * <p>
+        * @return Timestamp when this entry has been created
+        */
+       Date getCompanyCreated ();
+
+       /**
+        * Setter for timestamp when this entry has been created
+        * <p>
+        * @param contactCreated Timestamp when this entry has been created
+        */
+       void setCompanyCreated (final Date 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 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 getCompanyLandLineNumber ();
+
+       /**
+        * Setter for list of phone number
+        * <p>
+        * @param companyPhoneNumber Phone numbers
+        */
+       void setCompanyLandLineNumber (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 ();
+}
index e41f88309e00be9d2b8d6a3de5e95d26c1d9e621..9f844f15a78f20b4095de2ecb03199ad0bcf166d 100644 (file)
  */
 package org.mxchange.jcontactsbusiness.model.basicdata;
 
-import java.io.Serializable;
 import java.util.Date;
 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.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+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.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;
 
 /**
- * A POJI for business contact classes
+ * A POJO for business basic data
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public interface BusinessBasicData extends Serializable {
+@Entity (name = "company_basic_data")
+@Table (name = "company_basic_data")
+@NamedQueries (
+               {
+                       @NamedQuery (name = "AllBusinessData", query = "SELECT b FROM company_basic_data AS b ORDER BY b.basicDataId"),
+                       @NamedQuery (name = "SearchBusinessDataById", query = "SELECT b FROM company_basic_data AS b WHERE b.basicDataId = :basicDataId")
+               }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class BusinessBasicData implements BasicData {
 
        /**
-        * Getter for branches list
-        * <p>
-        * @return Branches list
+        * Serial number
         */
-       List<BranchOffice> getBrancheOffices ();
+       @Transient
+       private static final long serialVersionUID = 470_375_172_748_691L;
 
        /**
-        * Setter for branches list
-        * <p>
-        * @param branches Branches list
+        * Id number
         */
-       void setBrancheOffices (final List<BranchOffice> branches);
+       @Id
+       @Column (name = "company_data_id", nullable = false, updatable = false)
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       private Long basicDataId;
 
        /**
-        * Getter for company contact person
-        * <p>
-        * @return Company contact person
+        * Reference to company branch offices
         */
-       Employee getCompanyContactEmployee ();
+       @Transient
+       private List<BranchOffice> brancheOffices;
 
        /**
-        * Setter for company contact person
-        * <p>
-        * @param companyContact Company contact person
+        * Comments (any)
         */
-       void setCompanyContactEmployee (final Employee companyContact);
+       @Lob
+       @Column (name = "company_comments")
+       private String companyComments;
 
        /**
-        * Getter for business contact id
-        * <p>
-        * @return Business contact id
+        * Reference to contact person
         */
-       Long getBasicDataId ();
+       @JoinColumn (name = "company_contact_employee_id")
+       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.ALL)
+       private Employable companyContactEmployee;
 
        /**
-        * Setter for business contact id
-        * <p>
-        * @param businessContactId Business contact id
+        * Timestamp when this entry has been created
         */
-       void setBasicDataId (final Long businessContactId);
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "company_entry_created", nullable = false, updatable = false)
+       private Date companyCreated;
 
        /**
-        * Getter for company founder
-        * <p>
-        * @return Company founder
+        * Company's main email address (example: info@company.com)
         */
-       Employee getCompanyFounder ();
+       @Column (name = "company_email_address", length = 100)
+       private String companyEmailAddress;
 
        /**
-        * Setter for company founder
-        * <p>
-        * @param companyFounder Company founder
+        * Company's main fax numbers: +ccxxxxxxxxxx
         */
-       void setCompanyFounder (final Employee companyFounder);
+       @JoinColumn (name = "company_fax_number_id")
+       @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
+       private DialableFaxNumber companyFaxNumber;
 
        /**
-        * Getter for headquarters data
-        * <p>
-        * @return Headquarters data
+        * Reference to CEO "employee"
         */
-       HeadquartersData getCompanyHeadQuartersData ();
+       @JoinColumn (name = "company_founder_id")
+       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.ALL)
+       private Employable companyFounder;
 
        /**
-        * Setter for headquarters data
-        * <p>
-        * @param headQuartersData Headquarters data
+        * Reference to headquarters data
         */
-       void setCompanyHeadQuartersData (final HeadquartersData headQuartersData);
+       @JoinColumn (name = "company_headquarters_data_id")
+       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.ALL)
+       private HeadquartersData companyHeadQuartersData;
 
        /**
-        * Getter for user owner instance
-        * <p>
-        * @return User owner instance
+        * Company's main phone number: +ccxxxxxxxxxx
         */
-       User getCompanyUserOwner ();
+       @JoinColumn (name = "company_landline_number_id")
+       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+       private DialableLandLineNumber companyLandLineNumber;
 
        /**
-        * Setter for user owner instance
-        * <p>
-        * @param contactUserOwner User owner instance
+        * Id number of company logo
         */
-       void setCompanyUserOwner (final User contactUserOwner);
+       @JoinColumn (name = "company_logo_id")
+       @OneToOne (targetEntity = CompanyLogo.class, cascade = CascadeType.ALL)
+       private BusinessLogo companyLogo;
 
        /**
-        * Getter for timestamp when this entry has been created
-        * <p>
-        * @return Timestamp when this entry has been created
+        * Company name
         */
-       Date getCompanyCreated ();
+       @Basic (optional = false)
+       @Column (name = "company_name", length = 100, nullable = false, unique = true)
+       private String companyName;
 
        /**
-        * Setter for timestamp when this entry has been created
-        * <p>
-        * @param contactCreated Timestamp when this entry has been created
+        * Tax number
         */
-       void setCompanyCreated (final Date contactCreated);
+       @Column (name = "company_tax_number", length = 30)
+       private String companyTaxNumber;
 
        /**
-        * Getter for comments
-        * <p>
-        * @return Comments
+        * User owner instance
         */
-       String getCompanyComments ();
+       @JoinColumn (name = "company_owner_user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
+       private User companyUserOwner;
 
        /**
-        * Setter for comments
-        * <p>
-        * @param companyComments Comments
+        * URL for company website
         */
-       void setCompanyComments (final String companyComments);
+       @Column (name = "company_website_url")
+       private String companyWebsiteUrl;
 
        /**
-        * Getter for email address
-        * <p>
-        * @return Email address
+        * Default constructor, required for JPA
         */
-       String getCompanyEmailAddress ();
+       public BusinessBasicData () {
+       }
 
        /**
-        * Setter for email address
+        * Constructor with company name
         * <p>
-        * @param companyEmailAddress Email address
+        * @param companyName Company name
         */
-       void setCompanyEmailAddress (final String companyEmailAddress);
+       public BusinessBasicData (final String companyName) {
+               // First, validate all parameter
+               if (companyName == null) {
+                       // Is null
+                       throw new NullPointerException("companyName is null"); //NOI18N
+               } else if (companyName.isEmpty()) {
+                       // Is null
+                       throw new IllegalArgumentException("companyName is empty"); //NOI18N
+               }
+
+               // Set company name
+               this.companyName = companyName;
+       }
 
-       /**
-        * Getter for list of fax number
-        * <p>
-        * @return Fax numbers
-        */
-       DialableFaxNumber getCompanyFaxNumber ();
+       @Override
+       public boolean equals (final Object object) {
+               if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final BasicData other = (BasicData) object;
+
+               if (!Objects.equals(this.getBasicDataId(), other.getBasicDataId())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyName(), other.getCompanyName())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyHeadQuartersData(), other.getCompanyHeadQuartersData())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyContactEmployee(), other.getCompanyContactEmployee())) {
+                       return false;
+               } else if (!Objects.equals(this.getCompanyFounder(), other.getCompanyFounder())) {
+                       return false;
+               }
+
+               return true;
+       }
 
-       /**
-        * Setter for list of fax number
-        * <p>
-        * @param companyFaxNumber Fax numbers
-        */
-       void setCompanyFaxNumber (final DialableFaxNumber companyFaxNumber);
+       @Override
+       public Long getBasicDataId () {
+               return this.basicDataId;
+       }
 
-       /**
-        * Getter for company logo
-        * <p>
-        * @return Company logo
-        */
-       BusinessLogo getCompanyLogo ();
+       @Override
+       public void setBasicDataId (final Long basicDataId) {
+               this.basicDataId = basicDataId;
+       }
 
-       /**
-        * Setter for company logo
-        * <p>
-        * @param companyLogo Company logo
-        */
-       void setCompanyLogo (final BusinessLogo companyLogo);
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BranchOffice> getBrancheOffices () {
+               return this.brancheOffices;
+       }
 
-       /**
-        * Getter for company name
-        * <p>
-        * @return Company name
-        */
-       String getCompanyName ();
+       @Override
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setBrancheOffices (final List<BranchOffice> brancheOffices) {
+               this.brancheOffices = brancheOffices;
+       }
 
-       /**
-        * Setter for company name
-        * <p>
-        * @param companyName Company name
-        */
-       void setCompanyName (final String companyName);
+       @Override
+       public String getCompanyComments () {
+               return this.companyComments;
+       }
 
-       /**
-        * Getter for list of phone number
-        * <p>
-        * @return Phone numbers
-        */
-       DialableLandLineNumber getCompanyLandLineNumber ();
+       @Override
+       public void setCompanyComments (final String companyComments) {
+               this.companyComments = companyComments;
+       }
 
-       /**
-        * Setter for list of phone number
-        * <p>
-        * @param companyPhoneNumber Phone numbers
-        */
-       void setCompanyLandLineNumber (final DialableLandLineNumber companyPhoneNumber);
+       @Override
+       public Employable getCompanyContactEmployee () {
+               return this.companyContactEmployee;
+       }
 
-       /**
-        * Getter for tax number
-        * <p>
-        * @return Tax number
-        */
-       String getCompanyTaxNumber ();
+       @Override
+       public void setCompanyContactEmployee (final Employable companyContactEmployee) {
+               this.companyContactEmployee = companyContactEmployee;
+       }
 
-       /**
-        * Setter for tax number
-        * <p>
-        * @param companyTaxNumber Tax number
-        */
-       void setCompanyTaxNumber (final String companyTaxNumber);
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getCompanyCreated () {
+               return this.companyCreated;
+       }
 
-       /**
-        * Getter for website URL
-        * <p>
-        * @return Website URL
-        */
-       String getCompanyWebsiteUrl ();
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setCompanyCreated (final Date companyCreated) {
+               this.companyCreated = companyCreated;
+       }
 
-       /**
-        * Setter for website URL
-        * <p>
-        * @param companyWebsiteUrl Website URL
-        */
-       void setCompanyWebsiteUrl (final String companyWebsiteUrl);
+       @Override
+       public String getCompanyEmailAddress () {
+               return this.companyEmailAddress;
+       }
 
        @Override
-       boolean equals (final Object object);
+       public void setCompanyEmailAddress (final String companyEmailAddress) {
+               this.companyEmailAddress = companyEmailAddress;
+       }
 
        @Override
-       int hashCode ();
+       public DialableFaxNumber getCompanyFaxNumber () {
+               return this.companyFaxNumber;
+       }
+
+       @Override
+       public void setCompanyFaxNumber (final DialableFaxNumber companyFaxNumber) {
+               this.companyFaxNumber = companyFaxNumber;
+       }
+
+       @Override
+       public Employable getCompanyFounder () {
+               return this.companyFounder;
+       }
+
+       @Override
+       public void setCompanyFounder (final Employable companyFounder) {
+               this.companyFounder = companyFounder;
+       }
+
+       @Override
+       public HeadquartersData getCompanyHeadQuartersData () {
+               return this.companyHeadQuartersData;
+       }
+
+       @Override
+       public void setCompanyHeadQuartersData (final HeadquartersData companyHeadQuartersData) {
+               this.companyHeadQuartersData = companyHeadQuartersData;
+       }
+
+       @Override
+       public DialableLandLineNumber getCompanyLandLineNumber () {
+               return this.companyLandLineNumber;
+       }
+
+       @Override
+       public void setCompanyLandLineNumber (final DialableLandLineNumber companyLandLineNumber) {
+               this.companyLandLineNumber = companyLandLineNumber;
+       }
+
+       @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 String getCompanyTaxNumber () {
+               return this.companyTaxNumber;
+       }
+
+       @Override
+       public void setCompanyTaxNumber (final String companyTaxNumber) {
+               this.companyTaxNumber = companyTaxNumber;
+       }
+
+       @Override
+       public User getCompanyUserOwner () {
+               return this.companyUserOwner;
+       }
+
+       @Override
+       public void setCompanyUserOwner (final User companyUserOwner) {
+               this.companyUserOwner = companyUserOwner;
+       }
+
+       @Override
+       public String getCompanyWebsiteUrl () {
+               return this.companyWebsiteUrl;
+       }
+
+       @Override
+       public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
+               this.companyWebsiteUrl = companyWebsiteUrl;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 3;
+
+               hash = 37 * hash + Objects.hashCode(this.getBasicDataId());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyName());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyHeadQuartersData());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyContactEmployee());
+               hash = 37 * hash + Objects.hashCode(this.getCompanyFounder());
+
+               return hash;
+       }
+
 }
diff --git a/src/org/mxchange/jcontactsbusiness/model/basicdata/CompanyBasicData.java b/src/org/mxchange/jcontactsbusiness/model/basicdata/CompanyBasicData.java
deleted file mode 100644 (file)
index b8ff97a..0000000
+++ /dev/null
@@ -1,394 +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.model.basicdata;
-
-import java.util.Date;
-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.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployee;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData;
-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;
-
-/**
- * A POJO for business basic data
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_basic_data")
-@Table (name = "company_basic_data")
-@NamedQueries (
-               {
-                       @NamedQuery (name = "AllBusinessData", query = "SELECT b FROM company_basic_data AS b ORDER BY b.basicDataId"),
-                       @NamedQuery (name = "SearchBusinessDataById", query = "SELECT b FROM company_basic_data AS b WHERE b.basicDataId = :basicDataId")
-               }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyBasicData implements BusinessBasicData {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 470_375_172_748_691L;
-
-       /**
-        * Id number
-        */
-       @Id
-       @Column (name = "company_data_id", nullable = false, updatable = false)
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       private Long basicDataId;
-
-       /**
-        * Reference to company branch offices
-        */
-       @Transient
-       private List<BranchOffice> brancheOffices;
-
-       /**
-        * Comments (any)
-        */
-       @Lob
-       @Column (name = "company_comments")
-       private String companyComments;
-
-       /**
-        * Reference to contact person
-        */
-       @JoinColumn (name = "company_contact_employee_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
-       private Employee companyContactEmployee;
-
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "company_entry_created", nullable = false, updatable = false)
-       private Date companyCreated;
-
-       /**
-        * 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;
-
-       /**
-        * Reference to headquarters data
-        */
-       @JoinColumn (name = "company_headquarters_data_id")
-       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.ALL)
-       private HeadquartersData companyHeadQuartersData;
-
-       /**
-        * Company's main phone number: +ccxxxxxxxxxx
-        */
-       @JoinColumn (name = "company_landline_number_id")
-       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
-       private DialableLandLineNumber companyLandLineNumber;
-
-       /**
-        * 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, unique = true)
-       private String companyName;
-
-       /**
-        * Tax number
-        */
-       @Column (name = "company_tax_number", length = 30)
-       private String companyTaxNumber;
-
-       /**
-        * User owner instance
-        */
-       @JoinColumn (name = "company_owner_user_id")
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
-       private User companyUserOwner;
-
-       /**
-        * URL for company website
-        */
-       @Column (name = "company_website_url")
-       private String companyWebsiteUrl;
-
-       /**
-        * Default constructor, required for JPA
-        */
-       public CompanyBasicData () {
-       }
-
-       /**
-        * Constructor with company name
-        * <p>
-        * @param companyName Company name
-        */
-       public CompanyBasicData (final String companyName) {
-               // First, validate all parameter
-               if (companyName == null) {
-                       // Is null
-                       throw new NullPointerException("companyName is null"); //NOI18N
-               } else if (companyName.isEmpty()) {
-                       // Is null
-                       throw new IllegalArgumentException("companyName is empty"); //NOI18N
-               }
-
-               // Set company name
-               this.companyName = companyName;
-       }
-
-       @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.getBasicDataId(), other.getBasicDataId())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyName(), other.getCompanyName())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyHeadQuartersData(), other.getCompanyHeadQuartersData())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyContactEmployee(), other.getCompanyContactEmployee())) {
-                       return false;
-               } else if (!Objects.equals(this.getCompanyFounder(), other.getCompanyFounder())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       public Long getBasicDataId () {
-               return this.basicDataId;
-       }
-
-       @Override
-       public void setBasicDataId (final Long basicDataId) {
-               this.basicDataId = basicDataId;
-       }
-
-       @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 String getCompanyComments () {
-               return this.companyComments;
-       }
-
-       @Override
-       public void setCompanyComments (final String companyComments) {
-               this.companyComments = companyComments;
-       }
-
-       @Override
-       public Employee getCompanyContactEmployee () {
-               return this.companyContactEmployee;
-       }
-
-       @Override
-       public void setCompanyContactEmployee (final Employee companyContactEmployee) {
-               this.companyContactEmployee = companyContactEmployee;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getCompanyCreated () {
-               return this.companyCreated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setCompanyCreated (final Date companyCreated) {
-               this.companyCreated = companyCreated;
-       }
-
-       @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 HeadquartersData getCompanyHeadQuartersData () {
-               return this.companyHeadQuartersData;
-       }
-
-       @Override
-       public void setCompanyHeadQuartersData (final HeadquartersData companyHeadQuartersData) {
-               this.companyHeadQuartersData = companyHeadQuartersData;
-       }
-
-       @Override
-       public DialableLandLineNumber getCompanyLandLineNumber () {
-               return this.companyLandLineNumber;
-       }
-
-       @Override
-       public void setCompanyLandLineNumber (final DialableLandLineNumber companyLandLineNumber) {
-               this.companyLandLineNumber = companyLandLineNumber;
-       }
-
-       @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 String getCompanyTaxNumber () {
-               return this.companyTaxNumber;
-       }
-
-       @Override
-       public void setCompanyTaxNumber (final String companyTaxNumber) {
-               this.companyTaxNumber = companyTaxNumber;
-       }
-
-       @Override
-       public User getCompanyUserOwner () {
-               return this.companyUserOwner;
-       }
-
-       @Override
-       public void setCompanyUserOwner (final User companyUserOwner) {
-               this.companyUserOwner = companyUserOwner;
-       }
-
-       @Override
-       public String getCompanyWebsiteUrl () {
-               return this.companyWebsiteUrl;
-       }
-
-       @Override
-       public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
-               this.companyWebsiteUrl = companyWebsiteUrl;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 3;
-
-               hash = 37 * hash + Objects.hashCode(this.getBasicDataId());
-               hash = 37 * hash + Objects.hashCode(this.getCompanyName());
-               hash = 37 * hash + Objects.hashCode(this.getCompanyHeadQuartersData());
-               hash = 37 * hash + Objects.hashCode(this.getCompanyContactEmployee());
-               hash = 37 * hash + Objects.hashCode(this.getCompanyFounder());
-
-               return hash;
-       }
-
-}
index 11eef9608cff2704dc69983c11ab472dbe324fc9..0e09c86eff6e93daa5fc6d5a4e1a8e94c3e29253 100644 (file)
@@ -19,13 +19,13 @@ package org.mxchange.jcontactsbusiness.model.branchoffice;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcountry.model.data.Country;
 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.opening_time.OpeningTime;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * A POJI for branch offices
@@ -179,14 +179,14 @@ public interface BranchOffice extends Serializable {
         * <p>
         * @return Owning employee
         */
-       Employee getBranchOwnerEmployee ();
+       Employable getBranchOwnerEmployee ();
 
        /**
         * Setter for branch office owning employee
         * <p>
         * @param branchOwnerEmployee Owning employee
         */
-       void setBranchOwnerEmployee (final Employee branchOwnerEmployee);
+       void setBranchOwnerEmployee (final Employable branchOwnerEmployee);
 
        /**
         * Getter for branch office's ZIP code
@@ -235,28 +235,28 @@ public interface BranchOffice extends Serializable {
         * <p>
         * @return Branch office's company
         */
-       BusinessBasicData getBranchCompany ();
+       BasicData getBranchCompany ();
 
        /**
         * Setter for branch office's company
         * <p>
         * @param branchCompany Branch office's company
         */
-       void setBranchCompany (final BusinessBasicData branchCompany);
+       void setBranchCompany (final BasicData branchCompany);
 
        /**
         * Getter branch office's contact person
         * <p>
         * @return Branch office's contact person
         */
-       Employee getBranchContactEmployee ();
+       Employable getBranchContactEmployee ();
 
        /**
         * Setter branch office's contact person
         * <p>
         * @param branchEmployee Branch office's contact person
         */
-       void setBranchContactEmployee (final Employee branchEmployee);
+       void setBranchContactEmployee (final Employable branchEmployee);
 
        /**
         * Getter for user owner instance
diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BusinessBranchOffice.java
new file mode 100644 (file)
index 0000000..23e4114
--- /dev/null
@@ -0,0 +1,512 @@
+/*
+ * 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.branchoffice;
+
+import java.text.MessageFormat;
+import java.util.Date;
+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.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+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;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * A POJO for company branch offices
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "company_branch_offices")
+@Table (name = "company_branch_offices")
+@NamedQueries (
+               {
+                       @NamedQuery (name = "AllBranchOffices", query = "SELECT bo FROM company_branch_offices AS bo ORDER BY bo.branchId ASC"),
+                       @NamedQuery (name = "SearchBranchOfficeById", query = "SELECT bo FROM company_branch_offices AS bo WHERE bo.branchId = :branchOfficeId")
+               }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class BusinessBranchOffice implements BranchOffice {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 47_957_817_276_871_852L;
+
+       /**
+        * Branch office's city name
+        */
+       @Basic (optional = false)
+       @Column (name = "branch_city", length = 100, nullable = false)
+       private String branchCity;
+
+       /**
+        * Company that has this branch office
+        */
+       @JoinColumn (name = "branch_company_id", nullable = false, updatable = false)
+       @OneToOne (targetEntity = BusinessBasicData.class, optional = false, cascade = CascadeType.REFRESH)
+       private BasicData branchCompany;
+
+       /**
+        * Reference to contact person
+        */
+       @JoinColumn (name = "branch_contact_employee_id", referencedColumnName = "employee_id")
+       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.REFRESH)
+       private Employable branchContactEmployee;
+
+       /**
+        * Branch office's country code
+        */
+       @JoinColumn (name = "branch_country_id", referencedColumnName = "country_id", nullable = false)
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
+       private Country branchCountry;
+
+       /**
+        * Timestamp when this entry has been created
+        */
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "branch_entry_created", nullable = false, updatable = false)
+       private Date branchCreated;
+
+       /**
+        * Branch office's main email address (example: branch-name@company.com)
+        */
+       @Column (name = "branch_email_address", length = 100)
+       private String branchEmailAddress;
+
+       /**
+        * Branch office's main fax number: +ccxxxxxxxxxx
+        */
+       @JoinColumn (name = "branch_fax_number_id", referencedColumnName = "fax_id")
+       @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
+       private DialableFaxNumber branchFaxNumber;
+
+       /**
+        * Branch office's house number
+        */
+       @Basic (optional = false)
+       @Column (name = "branch_house_number", length = 3, nullable = false)
+       private Short branchHouseNumber;
+
+       /**
+        * Id number
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "branch_id", nullable = false, updatable = false)
+       private Long branchId;
+
+       /**
+        * Branch office's main land-line number: +ccxxxxxxxxxx
+        */
+       @JoinColumn (name = "branch_landline_number_id", referencedColumnName = "landline_id")
+       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+       private DialableLandLineNumber branchLandLineNumber;
+
+       /**
+        * Numer of this branch office
+        */
+       @Column (name = "branch_number")
+       private Long branchNumber;
+
+       /**
+        * Opening times for this branch office
+        */
+       @JoinTable (name = "branch_opening_times", joinColumns = @JoinColumn(name = "branch_opening_id", referencedColumnName = "branch_id"), inverseJoinColumns = @JoinColumn(name = "opening_branch_id", referencedColumnName = "opening_times_id"))
+       @ManyToMany (targetEntity = BusinessOpeningTime.class, cascade = CascadeType.ALL)
+       private List<OpeningTime> branchOpeningTimes;
+
+       /**
+        * Reference to branch office owner (for example some franchise supermarkets
+        * will have an owning person (here generally referred as "employee") who
+        * will own one or more branch offices.
+        */
+       @JoinColumn (name = "branch_owner_employee_id", referencedColumnName = "employee_id")
+       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.REFRESH)
+       private Employable branchOwnerEmployee;
+
+       /**
+        * Branch office's store (if multiple-store building)
+        */
+       @Column (name = "branch_store", length = 3)
+       private Short branchStore;
+
+       /**
+        * Branch office's street name
+        */
+       @Basic (optional = false)
+       @Column (name = "branch_street", length = 100, nullable = false)
+       private String branchStreet;
+
+       /**
+        * Branch office's suite number (if applyable)
+        */
+       @Column (name = "branch_suite_number", length = 4)
+       private Short branchSuiteNumber;
+
+       /**
+        * User owner instance
+        */
+       @JoinColumn (name = "branch_user_id", referencedColumnName = "user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
+       private User branchUserOwner;
+
+       /**
+        * Branch office's ZIP code
+        */
+       @Basic (optional = false)
+       @Column (name = "branch_zip_code", length = 6, nullable = false)
+       private Integer branchZipCode;
+
+       /**
+        * Default constructor for JPA
+        */
+       public BusinessBranchOffice () {
+       }
+
+       /**
+        * Constructor with all required fields. This constructor may throw
+        * exceptions when one parameter is not valid or NULL.
+        * <p>
+        * @param branchCity        Branch office's city
+        * @param branchCompany     Branch office's assigned company
+        * @param branchCountry     Branch office's country
+        * @param branchStreet      Branch office's street
+        * @param branchZipCode     Branch office's ZIP code
+        * @param branchHouseNumber Branch office's house number
+        */
+       public BusinessBranchOffice (final String branchCity, final BasicData branchCompany, final Country branchCountry, final String branchStreet, final Integer branchZipCode, final Short branchHouseNumber) {
+               // Call other constructor
+               this();
+
+               // Check all parameter
+               if (null == branchCity) {
+                       // Throw NPE
+                       throw new NullPointerException("branchCity is null"); //NOI18N
+               } else if (branchCity.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("branchCity is empty"); //NOI18N
+               } else if (null == branchCompany) {
+                       // Throw NPE
+                       throw new NullPointerException("branchCompany is null"); //NOI18N
+               } else if (branchCompany.getBasicDataId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("branchCompany.basicDataId is null"); //NOI18N
+               } else if (branchCompany.getBasicDataId() < 1) {
+                       // Throw IAE again
+                       throw new IllegalArgumentException(MessageFormat.format("branchCompany.basicDataId={0} is invalid", branchCompany.getBasicDataId())); //NOI18N
+               } else if (null == branchCountry) {
+                       // Throw NPE again
+                       throw new NullPointerException("branchCountry is null"); //NOI18N
+               } else if (branchCountry.getCountryId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("branchCountry.countryId is null"); //NOI18N
+               } else if (branchCountry.getCountryId() < 1) {
+                       // Throw IAE again
+                       throw new IllegalArgumentException(MessageFormat.format("branchCountry.countryId={0} is invalid", branchCountry.getCountryId())); //NOI18N
+               } else if (null == branchStreet) {
+                       // Throw NPE
+                       throw new NullPointerException("branchStreet is null"); //NOI18N
+               } else if (branchStreet.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("branchStreet is empty"); //NOI18N
+               } else if (null == branchZipCode) {
+                       // Throw NPE
+                       throw new NullPointerException("branchZipCode is null"); //NOI18N
+               } else if (branchZipCode < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("branchZipCode={0} is out of range.", branchZipCode)); //NOI18N
+               } else if (null == branchHouseNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("branchHouseNumber is null"); //NOI18N
+               } else if (branchHouseNumber < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("branchHouseNumber={0} is out of range.", branchHouseNumber)); //NOI18N
+               }
+
+               // Set all fields
+               this.branchCity = branchCity;
+               this.branchCompany = branchCompany;
+               this.branchCountry = branchCountry;
+               this.branchStreet = branchStreet;
+               this.branchZipCode = branchZipCode;
+               this.branchHouseNumber = branchHouseNumber;
+       }
+
+       @Override
+       public boolean equals (final Object object) {
+               if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final BranchOffice other = (BranchOffice) object;
+
+               if (!Objects.equals(this.getBranchId(), other.getBranchId())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchCity(), other.getBranchCity())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchCountry(), other.getBranchCountry())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchHouseNumber(), other.getBranchHouseNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchNumber(), other.getBranchNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchStore(), other.getBranchStore())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchStreet(), other.getBranchStreet())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchSuiteNumber(), other.getBranchSuiteNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getBranchZipCode(), other.getBranchZipCode())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       public String getBranchCity () {
+               return this.branchCity;
+       }
+
+       @Override
+       public void setBranchCity (final String branchCity) {
+               this.branchCity = branchCity;
+       }
+
+       @Override
+       public BasicData getBranchCompany () {
+               return this.branchCompany;
+       }
+
+       @Override
+       public void setBranchCompany (final BasicData branchCompany) {
+               this.branchCompany = branchCompany;
+       }
+
+       @Override
+       public Employable getBranchContactEmployee () {
+               return this.branchContactEmployee;
+       }
+
+       @Override
+       public void setBranchContactEmployee (final Employable branchContactEmployee) {
+               this.branchContactEmployee = branchContactEmployee;
+       }
+
+       @Override
+       public Country getBranchCountry () {
+               return this.branchCountry;
+       }
+
+       @Override
+       public void setBranchCountry (final Country branchCountry) {
+               this.branchCountry = branchCountry;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getBranchCreated () {
+               return this.branchCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setBranchCreated (final Date branchCreated) {
+               this.branchCreated = branchCreated;
+       }
+
+       @Override
+       public String getBranchEmailAddress () {
+               return this.branchEmailAddress;
+       }
+
+       @Override
+       public void setBranchEmailAddress (final String branchEmailAddress) {
+               this.branchEmailAddress = branchEmailAddress;
+       }
+
+       @Override
+       public DialableFaxNumber getBranchFaxNumber () {
+               return this.branchFaxNumber;
+       }
+
+       @Override
+       public void setBranchFaxNumber (final DialableFaxNumber branchFaxNumber) {
+               this.branchFaxNumber = branchFaxNumber;
+       }
+
+       @Override
+       public Short getBranchHouseNumber () {
+               return this.branchHouseNumber;
+       }
+
+       @Override
+       public void setBranchHouseNumber (final Short branchHouseNumber) {
+               this.branchHouseNumber = branchHouseNumber;
+       }
+
+       @Override
+       public Long getBranchId () {
+               return this.branchId;
+       }
+
+       @Override
+       public void setBranchId (final Long branchId) {
+               this.branchId = branchId;
+       }
+
+       @Override
+       public DialableLandLineNumber getBranchLandLineNumber () {
+               return this.branchLandLineNumber;
+       }
+
+       @Override
+       public void setBranchLandLineNumber (final DialableLandLineNumber branchLandLineNumber) {
+               this.branchLandLineNumber = branchLandLineNumber;
+       }
+
+       @Override
+       public Long getBranchNumber () {
+               return this.branchNumber;
+       }
+
+       @Override
+       public void setBranchNumber (final Long branchNumber) {
+               this.branchNumber = branchNumber;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<OpeningTime> getBranchOpeningTimes () {
+               return this.branchOpeningTimes;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes) {
+               this.branchOpeningTimes = branchOpeningTimes;
+       }
+
+       @Override
+       public Employable getBranchOwnerEmployee () {
+               return this.branchOwnerEmployee;
+       }
+
+       @Override
+       public void setBranchOwnerEmployee (final Employable branchOwnerEmployee) {
+               this.branchOwnerEmployee = branchOwnerEmployee;
+       }
+
+       @Override
+       public Short getBranchStore () {
+               return this.branchStore;
+       }
+
+       @Override
+       public void setBranchStore (final Short branchStore) {
+               this.branchStore = branchStore;
+       }
+
+       @Override
+       public String getBranchStreet () {
+               return this.branchStreet;
+       }
+
+       @Override
+       public void setBranchStreet (final String branchStreet) {
+               this.branchStreet = branchStreet;
+       }
+
+       @Override
+       public Short getBranchSuiteNumber () {
+               return this.branchSuiteNumber;
+       }
+
+       @Override
+       public void setBranchSuiteNumber (final Short branchSuiteNumber) {
+               this.branchSuiteNumber = branchSuiteNumber;
+       }
+
+       @Override
+       public User getBranchUserOwner () {
+               return this.branchUserOwner;
+       }
+
+       @Override
+       public void setBranchUserOwner (final User branchUserOwner) {
+               this.branchUserOwner = branchUserOwner;
+       }
+
+       @Override
+       public Integer getBranchZipCode () {
+               return this.branchZipCode;
+       }
+
+       @Override
+       public void setBranchZipCode (final Integer branchZipCode) {
+               this.branchZipCode = branchZipCode;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 7;
+
+               hash = 53 * hash + Objects.hashCode(this.getBranchId());
+               hash = 53 * hash + Objects.hashCode(this.getBranchCity());
+               hash = 53 * hash + Objects.hashCode(this.getBranchCountry());
+               hash = 53 * hash + Objects.hashCode(this.getBranchNumber());
+               hash = 53 * hash + Objects.hashCode(this.getBranchHouseNumber());
+               hash = 53 * hash + Objects.hashCode(this.getBranchStore());
+               hash = 53 * hash + Objects.hashCode(this.getBranchStreet());
+               hash = 53 * hash + Objects.hashCode(this.getBranchSuiteNumber());
+               hash = 53 * hash + Objects.hashCode(this.getBranchZipCode());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/CompanyBranchOffice.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/CompanyBranchOffice.java
deleted file mode 100644 (file)
index 76240d6..0000000
+++ /dev/null
@@ -1,512 +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.model.branchoffice;
-
-import java.text.MessageFormat;
-import java.util.Date;
-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.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData;
-import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployee;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
-import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
-import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
-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 branch offices
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_branch_offices")
-@Table (name = "company_branch_offices")
-@NamedQueries (
-               {
-                       @NamedQuery (name = "AllBranchOffices", query = "SELECT bo FROM company_branch_offices AS bo ORDER BY bo.branchId ASC"),
-                       @NamedQuery (name = "SearchBranchOfficeById", query = "SELECT bo FROM company_branch_offices AS bo WHERE bo.branchId = :branchOfficeId")
-               }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyBranchOffice implements BranchOffice {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 47_957_817_276_871_852L;
-
-       /**
-        * Branch office's city name
-        */
-       @Basic (optional = false)
-       @Column (name = "branch_city", length = 100, nullable = false)
-       private String branchCity;
-
-       /**
-        * Company that has this branch office
-        */
-       @JoinColumn (name = "branch_company_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyBasicData.class, optional = false, cascade = CascadeType.REFRESH)
-       private BusinessBasicData branchCompany;
-
-       /**
-        * Reference to contact person
-        */
-       @JoinColumn (name = "branch_contact_employee_id", referencedColumnName = "employee_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
-       private Employee branchContactEmployee;
-
-       /**
-        * Branch office's country code
-        */
-       @JoinColumn (name = "branch_country_id", referencedColumnName = "country_id", nullable = false)
-       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
-       private Country branchCountry;
-
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "branch_entry_created", nullable = false, updatable = false)
-       private Date branchCreated;
-
-       /**
-        * Branch office's main email address (example: branch-name@company.com)
-        */
-       @Column (name = "branch_email_address", length = 100)
-       private String branchEmailAddress;
-
-       /**
-        * Branch office's main fax number: +ccxxxxxxxxxx
-        */
-       @JoinColumn (name = "branch_fax_number_id", referencedColumnName = "fax_id")
-       @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
-       private DialableFaxNumber branchFaxNumber;
-
-       /**
-        * Branch office's house number
-        */
-       @Basic (optional = false)
-       @Column (name = "branch_house_number", length = 3, nullable = false)
-       private Short branchHouseNumber;
-
-       /**
-        * Id number
-        */
-       @Id
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       @Column (name = "branch_id", nullable = false, updatable = false)
-       private Long branchId;
-
-       /**
-        * Branch office's main land-line number: +ccxxxxxxxxxx
-        */
-       @JoinColumn (name = "branch_landline_number_id", referencedColumnName = "landline_id")
-       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
-       private DialableLandLineNumber branchLandLineNumber;
-
-       /**
-        * Numer of this branch office
-        */
-       @Column (name = "branch_number")
-       private Long branchNumber;
-
-       /**
-        * Opening times for this branch office
-        */
-       @JoinTable (name = "branch_opening_times", joinColumns = @JoinColumn(name = "branch_opening_id", referencedColumnName = "branch_id"), inverseJoinColumns = @JoinColumn(name = "opening_branch_id", referencedColumnName = "opening_times_id"))
-       @ManyToMany (targetEntity = BusinessOpeningTime.class, cascade = CascadeType.ALL)
-       private List<OpeningTime> branchOpeningTimes;
-
-       /**
-        * Reference to branch office owner (for example some franchise supermarkets
-        * will have an owning person (here generally referred as "employee") who
-        * will own one or more branch offices.
-        */
-       @JoinColumn (name = "branch_owner_employee_id", referencedColumnName = "employee_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
-       private Employee branchOwnerEmployee;
-
-       /**
-        * Branch office's store (if multiple-store building)
-        */
-       @Column (name = "branch_store", length = 3)
-       private Short branchStore;
-
-       /**
-        * Branch office's street name
-        */
-       @Basic (optional = false)
-       @Column (name = "branch_street", length = 100, nullable = false)
-       private String branchStreet;
-
-       /**
-        * Branch office's suite number (if applyable)
-        */
-       @Column (name = "branch_suite_number", length = 4)
-       private Short branchSuiteNumber;
-
-       /**
-        * User owner instance
-        */
-       @JoinColumn (name = "branch_user_id", referencedColumnName = "user_id")
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
-       private User branchUserOwner;
-
-       /**
-        * Branch office's ZIP code
-        */
-       @Basic (optional = false)
-       @Column (name = "branch_zip_code", length = 6, nullable = false)
-       private Integer branchZipCode;
-
-       /**
-        * Default constructor for JPA
-        */
-       public CompanyBranchOffice () {
-       }
-
-       /**
-        * Constructor with all required fields. This constructor may throw
-        * exceptions when one parameter is not valid or NULL.
-        * <p>
-        * @param branchCity        Branch office's city
-        * @param branchCompany     Branch office's assigned company
-        * @param branchCountry     Branch office's country
-        * @param branchStreet      Branch office's street
-        * @param branchZipCode     Branch office's ZIP code
-        * @param branchHouseNumber Branch office's house number
-        */
-       public CompanyBranchOffice (final String branchCity, final BusinessBasicData branchCompany, final Country branchCountry, final String branchStreet, final Integer branchZipCode, final Short branchHouseNumber) {
-               // Call other constructor
-               this();
-
-               // Check all parameter
-               if (null == branchCity) {
-                       // Throw NPE
-                       throw new NullPointerException("branchCity is null"); //NOI18N
-               } else if (branchCity.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("branchCity is empty"); //NOI18N
-               } else if (null == branchCompany) {
-                       // Throw NPE
-                       throw new NullPointerException("branchCompany is null"); //NOI18N
-               } else if (branchCompany.getBasicDataId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("branchCompany.basicDataId is null"); //NOI18N
-               } else if (branchCompany.getBasicDataId() < 1) {
-                       // Throw IAE again
-                       throw new IllegalArgumentException(MessageFormat.format("branchCompany.basicDataId={0} is invalid", branchCompany.getBasicDataId())); //NOI18N
-               } else if (null == branchCountry) {
-                       // Throw NPE again
-                       throw new NullPointerException("branchCountry is null"); //NOI18N
-               } else if (branchCountry.getCountryId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("branchCountry.countryId is null"); //NOI18N
-               } else if (branchCountry.getCountryId() < 1) {
-                       // Throw IAE again
-                       throw new IllegalArgumentException(MessageFormat.format("branchCountry.countryId={0} is invalid", branchCountry.getCountryId())); //NOI18N
-               } else if (null == branchStreet) {
-                       // Throw NPE
-                       throw new NullPointerException("branchStreet is null"); //NOI18N
-               } else if (branchStreet.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("branchStreet is empty"); //NOI18N
-               } else if (null == branchZipCode) {
-                       // Throw NPE
-                       throw new NullPointerException("branchZipCode is null"); //NOI18N
-               } else if (branchZipCode < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("branchZipCode={0} is out of range.", branchZipCode)); //NOI18N
-               } else if (null == branchHouseNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("branchHouseNumber is null"); //NOI18N
-               } else if (branchHouseNumber < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("branchHouseNumber={0} is out of range.", branchHouseNumber)); //NOI18N
-               }
-
-               // Set all fields
-               this.branchCity = branchCity;
-               this.branchCompany = branchCompany;
-               this.branchCountry = branchCountry;
-               this.branchStreet = branchStreet;
-               this.branchZipCode = branchZipCode;
-               this.branchHouseNumber = branchHouseNumber;
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final BranchOffice other = (BranchOffice) object;
-
-               if (!Objects.equals(this.getBranchId(), other.getBranchId())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchCity(), other.getBranchCity())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchCountry(), other.getBranchCountry())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchHouseNumber(), other.getBranchHouseNumber())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchNumber(), other.getBranchNumber())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchStore(), other.getBranchStore())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchStreet(), other.getBranchStreet())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchSuiteNumber(), other.getBranchSuiteNumber())) {
-                       return false;
-               } else if (!Objects.equals(this.getBranchZipCode(), other.getBranchZipCode())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       public String getBranchCity () {
-               return this.branchCity;
-       }
-
-       @Override
-       public void setBranchCity (final String branchCity) {
-               this.branchCity = branchCity;
-       }
-
-       @Override
-       public BusinessBasicData getBranchCompany () {
-               return this.branchCompany;
-       }
-
-       @Override
-       public void setBranchCompany (final BusinessBasicData branchCompany) {
-               this.branchCompany = branchCompany;
-       }
-
-       @Override
-       public Employee getBranchContactEmployee () {
-               return this.branchContactEmployee;
-       }
-
-       @Override
-       public void setBranchContactEmployee (final Employee branchContactEmployee) {
-               this.branchContactEmployee = branchContactEmployee;
-       }
-
-       @Override
-       public Country getBranchCountry () {
-               return this.branchCountry;
-       }
-
-       @Override
-       public void setBranchCountry (final Country branchCountry) {
-               this.branchCountry = branchCountry;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getBranchCreated () {
-               return this.branchCreated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setBranchCreated (final Date branchCreated) {
-               this.branchCreated = branchCreated;
-       }
-
-       @Override
-       public String getBranchEmailAddress () {
-               return this.branchEmailAddress;
-       }
-
-       @Override
-       public void setBranchEmailAddress (final String branchEmailAddress) {
-               this.branchEmailAddress = branchEmailAddress;
-       }
-
-       @Override
-       public DialableFaxNumber getBranchFaxNumber () {
-               return this.branchFaxNumber;
-       }
-
-       @Override
-       public void setBranchFaxNumber (final DialableFaxNumber branchFaxNumber) {
-               this.branchFaxNumber = branchFaxNumber;
-       }
-
-       @Override
-       public Short getBranchHouseNumber () {
-               return this.branchHouseNumber;
-       }
-
-       @Override
-       public void setBranchHouseNumber (final Short branchHouseNumber) {
-               this.branchHouseNumber = branchHouseNumber;
-       }
-
-       @Override
-       public Long getBranchId () {
-               return this.branchId;
-       }
-
-       @Override
-       public void setBranchId (final Long branchId) {
-               this.branchId = branchId;
-       }
-
-       @Override
-       public DialableLandLineNumber getBranchLandLineNumber () {
-               return this.branchLandLineNumber;
-       }
-
-       @Override
-       public void setBranchLandLineNumber (final DialableLandLineNumber branchLandLineNumber) {
-               this.branchLandLineNumber = branchLandLineNumber;
-       }
-
-       @Override
-       public Long getBranchNumber () {
-               return this.branchNumber;
-       }
-
-       @Override
-       public void setBranchNumber (final Long branchNumber) {
-               this.branchNumber = branchNumber;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<OpeningTime> getBranchOpeningTimes () {
-               return this.branchOpeningTimes;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes) {
-               this.branchOpeningTimes = branchOpeningTimes;
-       }
-
-       @Override
-       public Employee getBranchOwnerEmployee () {
-               return this.branchOwnerEmployee;
-       }
-
-       @Override
-       public void setBranchOwnerEmployee (final Employee branchOwnerEmployee) {
-               this.branchOwnerEmployee = branchOwnerEmployee;
-       }
-
-       @Override
-       public Short getBranchStore () {
-               return this.branchStore;
-       }
-
-       @Override
-       public void setBranchStore (final Short branchStore) {
-               this.branchStore = branchStore;
-       }
-
-       @Override
-       public String getBranchStreet () {
-               return this.branchStreet;
-       }
-
-       @Override
-       public void setBranchStreet (final String branchStreet) {
-               this.branchStreet = branchStreet;
-       }
-
-       @Override
-       public Short getBranchSuiteNumber () {
-               return this.branchSuiteNumber;
-       }
-
-       @Override
-       public void setBranchSuiteNumber (final Short branchSuiteNumber) {
-               this.branchSuiteNumber = branchSuiteNumber;
-       }
-
-       @Override
-       public User getBranchUserOwner () {
-               return this.branchUserOwner;
-       }
-
-       @Override
-       public void setBranchUserOwner (final User branchUserOwner) {
-               this.branchUserOwner = branchUserOwner;
-       }
-
-       @Override
-       public Integer getBranchZipCode () {
-               return this.branchZipCode;
-       }
-
-       @Override
-       public void setBranchZipCode (final Integer branchZipCode) {
-               this.branchZipCode = branchZipCode;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 7;
-
-               hash = 53 * hash + Objects.hashCode(this.getBranchId());
-               hash = 53 * hash + Objects.hashCode(this.getBranchCity());
-               hash = 53 * hash + Objects.hashCode(this.getBranchCountry());
-               hash = 53 * hash + Objects.hashCode(this.getBranchNumber());
-               hash = 53 * hash + Objects.hashCode(this.getBranchHouseNumber());
-               hash = 53 * hash + Objects.hashCode(this.getBranchStore());
-               hash = 53 * hash + Objects.hashCode(this.getBranchStreet());
-               hash = 53 * hash + Objects.hashCode(this.getBranchSuiteNumber());
-               hash = 53 * hash + Objects.hashCode(this.getBranchZipCode());
-
-               return hash;
-       }
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java b/src/org/mxchange/jcontactsbusiness/model/department/BusinessDepartment.java
new file mode 100644 (file)
index 0000000..a569a44
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ * 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.department;
+
+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.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+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.HeadquartersData;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * A POJO for company departments
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "company_departments")
+@Table (name = "company_departments")
+@NamedQueries (
+               {
+                       @NamedQuery (name = "AllDepartments", query = "SELECT d FROM company_departments AS d ORDER BY d.departmentId ASC")
+               }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class BusinessDepartment implements Department {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 94_835_918_958_717_660L;
+
+       /**
+        * Where this department is located
+        */
+       @JoinColumn (name = "department_branch_id")
+       @ManyToOne (targetEntity = BusinessBranchOffice.class, cascade = CascadeType.REFRESH)
+       private BranchOffice departmentBranchOffice;
+
+       /**
+        * Connection to business contact
+        */
+       @JoinColumn (name = "department_company_id", nullable = false, updatable = false)
+       @ManyToOne (targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH, optional = false)
+       private BasicData departmentCompany;
+
+       /**
+        * Timestamp when this entry has been created
+        */
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "department_created", nullable = false, updatable = false)
+       private Date departmentCreated;
+
+       /**
+        * Where this department is located
+        */
+       @JoinColumn (name = "department_headquarters_id")
+       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
+       private HeadquartersData departmentHeadquarters;
+
+       /**
+        * Department i18n key
+        */
+       @Basic (optional = false)
+       @Column (name = "department_i18n_key", length = 100, nullable = false)
+       private String departmentI18nKey;
+
+       /**
+        * Id number
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "department_id", nullable = false, updatable = false)
+       private Long departmentId;
+
+       /**
+        * Department lead employee
+        */
+       @JoinColumn (name = "department_lead_id")
+       @OneToOne (targetEntity = BusinessEmployee.class, cascade = CascadeType.REFRESH)
+       private Employable departmentLead;
+
+       /**
+        * User owner instance
+        */
+       @JoinColumn (name = "department_user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
+       private User departmentUserOwner;
+
+       /**
+        * Default constructor
+        */
+       public BusinessDepartment () {
+       }
+
+       /**
+        * Constructor with all required fields
+        * <p>
+        * @param departmentCompany Basic data instance
+        * @param departmentName    Department name
+        */
+       public BusinessDepartment (final BasicData departmentCompany, final String departmentName) {
+               // Call other constructor
+               this();
+
+               // Validate parameter
+               if (null == departmentCompany) {
+                       // Throw NPE
+                       throw new NullPointerException("departmentCompany is null"); //NOI18N
+               } else if (null == departmentName) {
+                       // Throw it again
+                       throw new NullPointerException("departmentName is null"); //NOI18N
+               } else if (departmentName.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("departmentName is empty"); //NOI18N
+               }
+
+               // Set all fields
+               this.departmentCompany = departmentCompany;
+               this.departmentI18nKey = departmentName;
+       }
+
+       @Override
+       public boolean equals (final Object object) {
+               if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final Department other = (Department) object;
+
+               if (!Objects.equals(this.getDepartmentId(), other.getDepartmentId())) {
+                       return false;
+               } else if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) {
+                       return false;
+               } else if (!Objects.equals(this.getDepartmentI18nKey(), other.getDepartmentI18nKey())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       public BranchOffice getDepartmentBranchOffice () {
+               return this.departmentBranchOffice;
+       }
+
+       @Override
+       public void setDepartmentBranchOffice (final BranchOffice departmentBranchOffice) {
+               this.departmentBranchOffice = departmentBranchOffice;
+       }
+
+       @Override
+       public BasicData getDepartmentCompany () {
+               return this.departmentCompany;
+       }
+
+       @Override
+       public void setDepartmentCompany (final BasicData departmentCompany) {
+               this.departmentCompany = departmentCompany;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getDepartmentCreated () {
+               return this.departmentCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setDepartmentCreated (final Date departmentCreated) {
+               this.departmentCreated = departmentCreated;
+       }
+
+       @Override
+       public HeadquartersData getDepartmentHeadquarters () {
+               return this.departmentHeadquarters;
+       }
+
+       @Override
+       public void setDepartmentHeadquarters (final HeadquartersData departmentHeadquarters) {
+               this.departmentHeadquarters = departmentHeadquarters;
+       }
+
+       @Override
+       public String getDepartmentI18nKey () {
+               return this.departmentI18nKey;
+       }
+
+       @Override
+       public void setDepartmentI18nKey (final String departmentI18nKey) {
+               this.departmentI18nKey = departmentI18nKey;
+       }
+
+       @Override
+       public Long getDepartmentId () {
+               return this.departmentId;
+       }
+
+       @Override
+       public void setDepartmentId (final Long departmentId) {
+               this.departmentId = departmentId;
+       }
+
+       @Override
+       public Employable getDepartmentLead () {
+               return this.departmentLead;
+       }
+
+       @Override
+       public void setDepartmentLead (final Employable departmentLead) {
+               this.departmentLead = departmentLead;
+       }
+
+       @Override
+       public User getDepartmentUserOwner () {
+               return this.departmentUserOwner;
+       }
+
+       @Override
+       public void setDepartmentUserOwner (final User departmentUserOwner) {
+               this.departmentUserOwner = departmentUserOwner;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 5;
+
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentId());
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentCompany());
+               hash = 53 * hash + Objects.hashCode(this.getDepartmentI18nKey());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/model/department/CompanyDepartment.java b/src/org/mxchange/jcontactsbusiness/model/department/CompanyDepartment.java
deleted file mode 100644 (file)
index 8929753..0000000
+++ /dev/null
@@ -1,274 +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.model.department;
-
-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.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.CompanyBranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployee;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
-import org.mxchange.jusercore.model.user.LoginUser;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A POJO for company departments
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_departments")
-@Table (name = "company_departments")
-@NamedQueries (
-               {
-                       @NamedQuery (name = "AllDepartments", query = "SELECT d FROM company_departments AS d ORDER BY d.departmentId ASC")
-               }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyDepartment implements Department {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 94_835_918_958_717_660L;
-
-       /**
-        * Where this department is located
-        */
-       @JoinColumn (name = "department_branch_id")
-       @ManyToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.REFRESH)
-       private BranchOffice departmentBranchOffice;
-
-       /**
-        * Connection to company contact
-        */
-       @JoinColumn (name = "department_company_id", nullable = false, updatable = false)
-       @ManyToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.REFRESH, optional = false)
-       private BusinessBasicData departmentCompany;
-
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "department_created", nullable = false, updatable = false)
-       private Date departmentCreated;
-
-       /**
-        * Where this department is located
-        */
-       @JoinColumn (name = "department_headquarters_id")
-       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
-       private HeadquartersData departmentHeadquarters;
-
-       /**
-        * Department i18n key
-        */
-       @Basic (optional = false)
-       @Column (name = "department_i18n_key", length = 100, nullable = false)
-       private String departmentI18nKey;
-
-       /**
-        * Id number
-        */
-       @Id
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       @Column (name = "department_id", nullable = false, updatable = false)
-       private Long departmentId;
-
-       /**
-        * Department lead employee
-        */
-       @JoinColumn (name = "department_lead_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
-       private Employee departmentLead;
-
-       /**
-        * User owner instance
-        */
-       @JoinColumn (name = "department_user_id")
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
-       private User departmentUserOwner;
-
-       /**
-        * Default constructor
-        */
-       public CompanyDepartment () {
-       }
-
-       /**
-        * Constructor with all required fields
-        * <p>
-        * @param departmentCompany Basic data instance
-        * @param departmentName    Department name
-        */
-       public CompanyDepartment (final BusinessBasicData departmentCompany, final String departmentName) {
-               // Call other constructor
-               this();
-
-               // Validate parameter
-               if (null == departmentCompany) {
-                       // Throw NPE
-                       throw new NullPointerException("departmentCompany is null"); //NOI18N
-               } else if (null == departmentName) {
-                       // Throw it again
-                       throw new NullPointerException("departmentName is null"); //NOI18N
-               } else if (departmentName.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("departmentName is empty"); //NOI18N
-               }
-
-               // Set all fields
-               this.departmentCompany = departmentCompany;
-               this.departmentI18nKey = departmentName;
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final Department other = (Department) object;
-
-               if (!Objects.equals(this.getDepartmentId(), other.getDepartmentId())) {
-                       return false;
-               } else if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) {
-                       return false;
-               } else if (!Objects.equals(this.getDepartmentI18nKey(), other.getDepartmentI18nKey())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       public BranchOffice getDepartmentBranchOffice () {
-               return this.departmentBranchOffice;
-       }
-
-       @Override
-       public void setDepartmentBranchOffice (final BranchOffice departmentBranchOffice) {
-               this.departmentBranchOffice = departmentBranchOffice;
-       }
-
-       @Override
-       public BusinessBasicData getDepartmentCompany () {
-               return this.departmentCompany;
-       }
-
-       @Override
-       public void setDepartmentCompany (final BusinessBasicData departmentCompany) {
-               this.departmentCompany = departmentCompany;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getDepartmentCreated () {
-               return this.departmentCreated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setDepartmentCreated (final Date departmentCreated) {
-               this.departmentCreated = departmentCreated;
-       }
-
-       @Override
-       public HeadquartersData getDepartmentHeadquarters () {
-               return this.departmentHeadquarters;
-       }
-
-       @Override
-       public void setDepartmentHeadquarters (final HeadquartersData departmentHeadquarters) {
-               this.departmentHeadquarters = departmentHeadquarters;
-       }
-
-       @Override
-       public String getDepartmentI18nKey () {
-               return this.departmentI18nKey;
-       }
-
-       @Override
-       public void setDepartmentI18nKey (final String departmentI18nKey) {
-               this.departmentI18nKey = departmentI18nKey;
-       }
-
-       @Override
-       public Long getDepartmentId () {
-               return this.departmentId;
-       }
-
-       @Override
-       public void setDepartmentId (final Long departmentId) {
-               this.departmentId = departmentId;
-       }
-
-       @Override
-       public Employee getDepartmentLead () {
-               return this.departmentLead;
-       }
-
-       @Override
-       public void setDepartmentLead (final Employee departmentLead) {
-               this.departmentLead = departmentLead;
-       }
-
-       @Override
-       public User getDepartmentUserOwner () {
-               return this.departmentUserOwner;
-       }
-
-       @Override
-       public void setDepartmentUserOwner (final User departmentUserOwner) {
-               this.departmentUserOwner = departmentUserOwner;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 5;
-
-               hash = 53 * hash + Objects.hashCode(this.getDepartmentId());
-               hash = 53 * hash + Objects.hashCode(this.getDepartmentCompany());
-               hash = 53 * hash + Objects.hashCode(this.getDepartmentI18nKey());
-
-               return hash;
-       }
-
-}
index 9583a731ef1e3854d46cbc1e1267e5dc3e4db41a..7c75dcbdae4293facad5cdc68031125f8c95bc8b 100644 (file)
@@ -18,11 +18,11 @@ package org.mxchange.jcontactsbusiness.model.department;
 
 import java.io.Serializable;
 import java.util.Date;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
 import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * A POJI for company departments
@@ -32,18 +32,18 @@ import org.mxchange.jusercore.model.user.User;
 public interface Department extends Serializable {
 
        /**
-        * Getter for connection to company contact
+        * Getter for connection to business contact
         * <p>
-        * @return Connection to company contact
+        * @return Connection to business contact
         */
-       BusinessBasicData getDepartmentCompany ();
+       BasicData getDepartmentCompany ();
 
        /**
-        * Setter for connection to company contact
+        * Setter for connection to business contact
         * <p>
-        * @param departmentCompany Connection to company contact
+        * @param departmentCompany Connection to business contact
         */
-       void setDepartmentCompany (final BusinessBasicData departmentCompany);
+       void setDepartmentCompany (final BasicData departmentCompany);
 
        /**
         * Getter for connection to company headquarters
@@ -92,14 +92,14 @@ public interface Department extends Serializable {
         * <p>
         * @return Department lead employee
         */
-       Employee getDepartmentLead ();
+       Employable getDepartmentLead ();
 
        /**
         * Setter for department lead employee
         * <p>
         * @param departmentLead Department lead employee
         */
-       void setDepartmentLead (final Employee departmentLead);
+       void setDepartmentLead (final Employable departmentLead);
 
        /**
         * Getter for department i18n key
diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java b/src/org/mxchange/jcontactsbusiness/model/employee/BusinessEmployee.java
new file mode 100644 (file)
index 0000000..d821779
--- /dev/null
@@ -0,0 +1,357 @@
+/*
+ * 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.employee;
+
+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.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.UserContact;
+import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+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.HeadquartersData;
+import org.mxchange.jcontactsbusiness.model.jobposition.EmployeePosition;
+import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * A POJO for company employees (including CEO)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "company_employees")
+@Table (name = "company_employees")
+@NamedQueries (
+               {
+                       @NamedQuery (name = "AllEmployees", query = "SELECT e FROM company_employees AS e ORDER BY e.employeeId ASC"),
+                       @NamedQuery (name = "SearchEmployeeById", query = "SELECT e FROM company_employees AS e WHERE e.employeeId = :employeeId")
+               }
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class BusinessEmployee implements Employable {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 48_959_819_859_812_076L;
+
+       /**
+        * Branch office (if the employee works there)
+        */
+       @JoinColumn (name = "employee_branch_id")
+       @OneToOne (targetEntity = BusinessBranchOffice.class, cascade = CascadeType.REFRESH)
+       private BranchOffice employeeBranchOffice;
+
+       /**
+        * Company the employee is working at
+        */
+       @JoinColumn (name = "employee_company_id", nullable = false, updatable = false)
+       @OneToOne (targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH, optional = false)
+       private BasicData employeeCompany;
+
+       /**
+        * Timestamp when this entry has been created
+        */
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "employee_entry_created", nullable = false, updatable = false)
+       private Date employeeCreated;
+
+       /**
+        * Department the employee works at
+        */
+       @JoinColumn (name = "employee_department_id")
+       @OneToOne (targetEntity = BusinessDepartment.class, cascade = CascadeType.REFRESH)
+       private Department employeeDepartment;
+
+       /**
+        * Employable's email address
+        */
+       @Column (name = "employee_email_address", length = 30)
+       private String employeeEmailAddress;
+
+       /**
+        * Head quarters id number (if the employee works there)
+        */
+       @JoinColumn (name = "employee_headquarters_id")
+       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
+       private HeadquartersData employeeHeadquarter;
+
+       /**
+        * Id number
+        */
+       @Id
+       @Column (name = "employee_id", nullable = false, updatable = false)
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       private Long employeeId;
+
+       /**
+        * Employable's business mobile number
+        */
+       @JoinColumn (name = "employee_mobile_number_id")
+       @OneToOne (targetEntity = MobileNumber.class, cascade = CascadeType.REFRESH)
+       private DialableMobileNumber employeeMobileNumber;
+
+       /**
+        * Employable's staff number
+        */
+       @Column (name = "employee_staff_number", length = 20)
+       private String employeeNumber;
+
+       /**
+        * Employable's personal data
+        */
+       @JoinColumn (name = "employee_personal_data_id")
+       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
+       private Contact employeePersonalData;
+
+       /**
+        * Employable's phone extension (or number if different)
+        */
+       @Column (name = "employee_phone_extension", length = 10)
+       private Integer employeePhoneExtension;
+
+       /**
+        * Employable's position (example: CEO)
+        */
+       @JoinColumn (name = "employee_position_id")
+       @OneToOne (targetEntity = EmployeePosition.class, cascade = CascadeType.REFRESH)
+       private JobPosition employeePosition;
+
+       /**
+        * User owner instance
+        */
+       @JoinColumn (name = "employee_user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
+       private User employeeUserOwner;
+
+       /**
+        * Default constructor
+        */
+       public BusinessEmployee () {
+       }
+
+       public BusinessEmployee (final BasicData employeeCompany, final String employeeNumber, final Contact employeePersonalData) {
+               // Call other constructor
+               this();
+
+               // Validate parameter
+               if (null == employeeCompany) {
+                       // Throw NPE
+                       throw new NullPointerException("employeeCompany is null"); //NOI18N
+               } else if (((null == employeeNumber) || (employeeNumber.isEmpty()) && (null == employeePersonalData))) {
+                       // At least one must be given
+                       throw new NullPointerException("employeeNumber or employeeContact must be set."); //NOI18N
+               }
+
+               // Set all fields
+               this.employeeCompany = employeeCompany;
+               this.employeeNumber = employeeNumber;
+               this.employeePersonalData = employeePersonalData;
+       }
+
+       @Override
+       public boolean equals (final Object object) {
+               if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final Employable other = (Employable) object;
+
+               if (!Objects.equals(this.getEmployeeId(), other.getEmployeeId())) {
+                       return false;
+               } else if (!Objects.equals(this.getEmployeeCompany(), other.getEmployeeCompany())) {
+                       return false;
+               } else if (!Objects.equals(this.getEmployeeNumber(), other.getEmployeeNumber())) {
+                       return false;
+               } else if (!Objects.equals(this.getEmployeePersonalData(), other.getEmployeePersonalData())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       public BranchOffice getEmployeeBranchOffice () {
+               return this.employeeBranchOffice;
+       }
+
+       @Override
+       public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice) {
+               this.employeeBranchOffice = employeeBranchOffice;
+       }
+
+       @Override
+       public BasicData getEmployeeCompany () {
+               return this.employeeCompany;
+       }
+
+       @Override
+       public void setEmployeeCompany (final BasicData employeeCompany) {
+               this.employeeCompany = employeeCompany;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getEmployeeCreated () {
+               return this.employeeCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setEmployeeCreated (final Date employeeCreated) {
+               this.employeeCreated = employeeCreated;
+       }
+
+       @Override
+       public Department getEmployeeDepartment () {
+               return this.employeeDepartment;
+       }
+
+       @Override
+       public void setEmployeeDepartment (final Department employeeDepartment) {
+               this.employeeDepartment = employeeDepartment;
+       }
+
+       @Override
+       public String getEmployeeEmailAddress () {
+               return this.employeeEmailAddress;
+       }
+
+       @Override
+       public void setEmployeeEmailAddress (final String employeeEmailAddress) {
+               this.employeeEmailAddress = employeeEmailAddress;
+       }
+
+       @Override
+       public HeadquartersData getEmployeeHeadquarter () {
+               return this.employeeHeadquarter;
+       }
+
+       @Override
+       public void setEmployeeHeadquarter (final HeadquartersData employeeHeadquarter) {
+               this.employeeHeadquarter = employeeHeadquarter;
+       }
+
+       @Override
+       public Long getEmployeeId () {
+               return this.employeeId;
+       }
+
+       @Override
+       public void setEmployeeId (final Long employeeId) {
+               this.employeeId = employeeId;
+       }
+
+       @Override
+       public DialableMobileNumber getEmployeeMobileNumber () {
+               return this.employeeMobileNumber;
+       }
+
+       @Override
+       public void setEmployeeMobileNumber (final DialableMobileNumber employeeMobileNumber) {
+               this.employeeMobileNumber = employeeMobileNumber;
+       }
+
+       @Override
+       public String getEmployeeNumber () {
+               return this.employeeNumber;
+       }
+
+       @Override
+       public void setEmployeeNumber (final String employeeNumber) {
+               this.employeeNumber = employeeNumber;
+       }
+
+       @Override
+       public Contact getEmployeePersonalData () {
+               return this.employeePersonalData;
+       }
+
+       @Override
+       public void setEmployeePersonalData (final Contact employeePersonalData) {
+               this.employeePersonalData = employeePersonalData;
+       }
+
+       @Override
+       public Integer getEmployeePhoneExtension () {
+               return this.employeePhoneExtension;
+       }
+
+       @Override
+       public void setEmployeePhoneExtension (final Integer employeePhoneExtension) {
+               this.employeePhoneExtension = employeePhoneExtension;
+       }
+
+       @Override
+       public JobPosition getEmployeePosition () {
+               return this.employeePosition;
+       }
+
+       @Override
+       public void setEmployeePosition (final JobPosition employeePosition) {
+               this.employeePosition = employeePosition;
+       }
+
+       @Override
+       public User getEmployeeUserOwner () {
+               return this.employeeUserOwner;
+       }
+
+       @Override
+       public void setEmployeeUserOwner (final User employeeUserOwner) {
+               this.employeeUserOwner = employeeUserOwner;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 3;
+
+               hash = 97 * hash + Objects.hashCode(this.getEmployeeId());
+               hash = 97 * hash + Objects.hashCode(this.getEmployeeCompany());
+               hash = 97 * hash + Objects.hashCode(this.getEmployeeNumber());
+               hash = 97 * hash + Objects.hashCode(this.getEmployeePersonalData());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/CompanyEmployee.java b/src/org/mxchange/jcontactsbusiness/model/employee/CompanyEmployee.java
deleted file mode 100644 (file)
index 327144b..0000000
+++ /dev/null
@@ -1,357 +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.model.employee;
-
-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.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcontacts.model.contact.UserContact;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.CompanyBranchOffice;
-import org.mxchange.jcontactsbusiness.model.department.CompanyDepartment;
-import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
-import org.mxchange.jcontactsbusiness.model.jobposition.EmployeePosition;
-import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
-import org.mxchange.jusercore.model.user.LoginUser;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A POJO for company employees (including CEO)
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "company_employees")
-@Table (name = "company_employees")
-@NamedQueries (
-               {
-                       @NamedQuery (name = "AllCompanyEmployees", query = "SELECT e FROM company_employees AS e ORDER BY e.employeeId ASC"),
-                       @NamedQuery (name = "SearchCompanyEmployeeById", query = "SELECT e FROM company_employees AS e WHERE e.employeeId = :employeeId")
-               }
-)
-@SuppressWarnings ("PersistenceUnitPresent")
-public class CompanyEmployee implements Employee {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 48_959_819_859_812_076L;
-
-       /**
-        * Branch office (if the employee works there)
-        */
-       @JoinColumn (name = "employee_branch_id")
-       @OneToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.REFRESH)
-       private BranchOffice employeeBranchOffice;
-
-       /**
-        * Company the employee is working at
-        */
-       @JoinColumn (name = "employee_company_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.REFRESH, optional = false)
-       private BusinessBasicData employeeCompany;
-
-       /**
-        * Timestamp when this entry has been created
-        */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "employee_entry_created", nullable = false, updatable = false)
-       private Date employeeCreated;
-
-       /**
-        * Department the employee works at
-        */
-       @JoinColumn (name = "employee_department_id")
-       @OneToOne (targetEntity = CompanyDepartment.class, cascade = CascadeType.REFRESH)
-       private Department employeeDepartment;
-
-       /**
-        * Employee's email address
-        */
-       @Column (name = "employee_email_address", length = 30)
-       private String employeeEmailAddress;
-
-       /**
-        * Head quarters id number (if the employee works there)
-        */
-       @JoinColumn (name = "employee_headquarters_id")
-       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
-       private HeadquartersData employeeHeadquarter;
-
-       /**
-        * Id number
-        */
-       @Id
-       @Column (name = "employee_id", nullable = false, updatable = false)
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       private Long employeeId;
-
-       /**
-        * Employee's business mobile number
-        */
-       @JoinColumn (name = "employee_mobile_number_id")
-       @OneToOne (targetEntity = MobileNumber.class, cascade = CascadeType.REFRESH)
-       private DialableMobileNumber employeeMobileNumber;
-
-       /**
-        * Employee's staff number
-        */
-       @Column (name = "employee_staff_number", length = 20)
-       private String employeeNumber;
-
-       /**
-        * Employee's personal data
-        */
-       @JoinColumn (name = "employee_personal_data_id")
-       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
-       private Contact employeePersonalData;
-
-       /**
-        * Employee's phone extension (or number if different)
-        */
-       @Column (name = "employee_phone_extension", length = 10)
-       private Integer employeePhoneExtension;
-
-       /**
-        * Employee's position (example: CEO)
-        */
-       @JoinColumn (name = "employee_position_id")
-       @OneToOne (targetEntity = EmployeePosition.class, cascade = CascadeType.REFRESH)
-       private JobPosition employeePosition;
-
-       /**
-        * User owner instance
-        */
-       @JoinColumn (name = "employee_user_id")
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
-       private User employeeUserOwner;
-
-       /**
-        * Default constructor
-        */
-       public CompanyEmployee () {
-       }
-
-       public CompanyEmployee (final BusinessBasicData employeeCompany, final String employeeNumber, final Contact employeePersonalData) {
-               // Call other constructor
-               this();
-
-               // Validate parameter
-               if (null == employeeCompany) {
-                       // Throw NPE
-                       throw new NullPointerException("employeeCompany is null"); //NOI18N
-               } else if (((null == employeeNumber) || (employeeNumber.isEmpty()) && (null == employeePersonalData))) {
-                       // At least one must be given
-                       throw new NullPointerException("employeeNumber or employeeContact must be set."); //NOI18N
-               }
-
-               // Set all fields
-               this.employeeCompany = employeeCompany;
-               this.employeeNumber = employeeNumber;
-               this.employeePersonalData = employeePersonalData;
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final Employee other = (Employee) object;
-
-               if (!Objects.equals(this.getEmployeeId(), other.getEmployeeId())) {
-                       return false;
-               } else if (!Objects.equals(this.getEmployeeCompany(), other.getEmployeeCompany())) {
-                       return false;
-               } else if (!Objects.equals(this.getEmployeeNumber(), other.getEmployeeNumber())) {
-                       return false;
-               } else if (!Objects.equals(this.getEmployeePersonalData(), other.getEmployeePersonalData())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       public BranchOffice getEmployeeBranchOffice () {
-               return this.employeeBranchOffice;
-       }
-
-       @Override
-       public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice) {
-               this.employeeBranchOffice = employeeBranchOffice;
-       }
-
-       @Override
-       public BusinessBasicData getEmployeeCompany () {
-               return this.employeeCompany;
-       }
-
-       @Override
-       public void setEmployeeCompany (final BusinessBasicData employeeCompany) {
-               this.employeeCompany = employeeCompany;
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getEmployeeCreated () {
-               return this.employeeCreated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setEmployeeCreated (final Date employeeCreated) {
-               this.employeeCreated = employeeCreated;
-       }
-
-       @Override
-       public Department getEmployeeDepartment () {
-               return this.employeeDepartment;
-       }
-
-       @Override
-       public void setEmployeeDepartment (final Department employeeDepartment) {
-               this.employeeDepartment = employeeDepartment;
-       }
-
-       @Override
-       public String getEmployeeEmailAddress () {
-               return this.employeeEmailAddress;
-       }
-
-       @Override
-       public void setEmployeeEmailAddress (final String employeeEmailAddress) {
-               this.employeeEmailAddress = employeeEmailAddress;
-       }
-
-       @Override
-       public HeadquartersData getEmployeeHeadquarter () {
-               return this.employeeHeadquarter;
-       }
-
-       @Override
-       public void setEmployeeHeadquarter (final HeadquartersData employeeHeadquarter) {
-               this.employeeHeadquarter = employeeHeadquarter;
-       }
-
-       @Override
-       public Long getEmployeeId () {
-               return this.employeeId;
-       }
-
-       @Override
-       public void setEmployeeId (final Long employeeId) {
-               this.employeeId = employeeId;
-       }
-
-       @Override
-       public DialableMobileNumber getEmployeeMobileNumber () {
-               return this.employeeMobileNumber;
-       }
-
-       @Override
-       public void setEmployeeMobileNumber (final DialableMobileNumber employeeMobileNumber) {
-               this.employeeMobileNumber = employeeMobileNumber;
-       }
-
-       @Override
-       public String getEmployeeNumber () {
-               return this.employeeNumber;
-       }
-
-       @Override
-       public void setEmployeeNumber (final String employeeNumber) {
-               this.employeeNumber = employeeNumber;
-       }
-
-       @Override
-       public Contact getEmployeePersonalData () {
-               return this.employeePersonalData;
-       }
-
-       @Override
-       public void setEmployeePersonalData (final Contact employeePersonalData) {
-               this.employeePersonalData = employeePersonalData;
-       }
-
-       @Override
-       public Integer getEmployeePhoneExtension () {
-               return this.employeePhoneExtension;
-       }
-
-       @Override
-       public void setEmployeePhoneExtension (final Integer employeePhoneExtension) {
-               this.employeePhoneExtension = employeePhoneExtension;
-       }
-
-       @Override
-       public JobPosition getEmployeePosition () {
-               return this.employeePosition;
-       }
-
-       @Override
-       public void setEmployeePosition (final JobPosition employeePosition) {
-               this.employeePosition = employeePosition;
-       }
-
-       @Override
-       public User getEmployeeUserOwner () {
-               return this.employeeUserOwner;
-       }
-
-       @Override
-       public void setEmployeeUserOwner (final User employeeUserOwner) {
-               this.employeeUserOwner = employeeUserOwner;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 3;
-
-               hash = 97 * hash + Objects.hashCode(this.getEmployeeId());
-               hash = 97 * hash + Objects.hashCode(this.getEmployeeCompany());
-               hash = 97 * hash + Objects.hashCode(this.getEmployeeNumber());
-               hash = 97 * hash + Objects.hashCode(this.getEmployeePersonalData());
-
-               return hash;
-       }
-
-}
diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/Employable.java b/src/org/mxchange/jcontactsbusiness/model/employee/Employable.java
new file mode 100644 (file)
index 0000000..d4eecde
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * 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.employee;
+
+import java.io.Serializable;
+import java.util.Date;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
+import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * A POJI for employees
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface Employable extends Serializable {
+
+       /**
+        * Getter for employee's branch office
+        * <p>
+        * @return Employable's branch office
+        */
+       BranchOffice getEmployeeBranchOffice ();
+
+       /**
+        * Setter for employee's branch office
+        * <p>
+        * @param employeeBranchOffice Employable's branch office
+        */
+       void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice);
+
+       /**
+        * Getter for employee's company
+        * <p>
+        * @return Company instance
+        */
+       BasicData getEmployeeCompany ();
+
+       /**
+        * Setter for employee's company
+        * <p>
+        * @param employeeCompany Company instance
+        */
+       void setEmployeeCompany (final BasicData employeeCompany);
+
+       /**
+        * Getter for employee's department
+        * <p>
+        * @return Employable's department
+        */
+       Department getEmployeeDepartment ();
+
+       /**
+        * Setter for employee's department
+        * <p>
+        * @param employeeDepartment Employable's department
+        */
+       void setEmployeeDepartment (final Department employeeDepartment);
+
+       /**
+        * Getter for employee's head quarters
+        * <p>
+        * @return Employable's head quarters
+        */
+       HeadquartersData getEmployeeHeadquarter ();
+
+       /**
+        * Getter for employee's head quarters
+        * <p>
+        * @param employeeHeadquarter Employable's head quarters
+        */
+       void setEmployeeHeadquarter (final HeadquartersData employeeHeadquarter);
+
+       /**
+        * Getter for employee's email address
+        * <p>
+        * @return Employable's email address
+        */
+       String getEmployeeEmailAddress ();
+
+       /**
+        * Setter for employee's email address
+        * <p>
+        * @param employeeEmailAddress Employable's email address
+        */
+       void setEmployeeEmailAddress (final String employeeEmailAddress);
+
+       /**
+        * Getter for employee's id number
+        * <p>
+        * @return Employable's id number
+        */
+       Long getEmployeeId ();
+
+       /**
+        * Setter for employee's id number
+        * <p>
+        * @param employeeId Employable's id number
+        */
+       void setEmployeeId (final Long employeeId);
+
+       /**
+        * Getter for employee's mobile number
+        * <p>
+        * @return Employable's mobile number
+        */
+       DialableMobileNumber getEmployeeMobileNumber ();
+
+       /**
+        * Setter for employee's mobile number
+        * <p>
+        * @param employeeMobileNumber Employable's mobile number
+        */
+       void setEmployeeMobileNumber (final DialableMobileNumber employeeMobileNumber);
+
+       /**
+        * Getter for employee's number
+        * <p>
+        * @return Employable's number
+        */
+       String getEmployeeNumber ();
+
+       /**
+        * Setter for employee's number
+        * <p>
+        * @param employeeNumber Employable's number
+        */
+       void setEmployeeNumber (final String employeeNumber);
+
+       /**
+        * Getter for employee's personal data
+        * <p>
+        * @return Employable's personal data
+        */
+       Contact getEmployeePersonalData ();
+
+       /**
+        * Setter for employee's personal data
+        * <p>
+        * @param employeePersonalData Employable's personal data
+        */
+       void setEmployeePersonalData (final Contact employeePersonalData);
+
+       /**
+        * Getter for employee's phone number/extension
+        * <p>
+        * @return Employable's phone number/extension
+        */
+       Integer getEmployeePhoneExtension ();
+
+       /**
+        * Setter for employee's phone number/extension
+        * <p>
+        * @param employeePhoneExtension Employable's phone number/extension
+        */
+       void setEmployeePhoneExtension (final Integer employeePhoneExtension);
+
+       /**
+        * Getter for employee's position
+        * <p>
+        * @return Employable's position
+        */
+       JobPosition getEmployeePosition ();
+
+       /**
+        * Setter for employee's position
+        * <p>
+        * @param employeePosition Employable's position
+        */
+       void setEmployeePosition (final JobPosition employeePosition);
+
+       /**
+        * Getter for user owner instance
+        * <p>
+        * @return User owner instance
+        */
+       User getEmployeeUserOwner ();
+
+       /**
+        * Setter for user owner instance
+        * <p>
+        * @param employeeUserOwner User owner instance
+        */
+       void setEmployeeUserOwner (final User employeeUserOwner);
+
+       /**
+        * Getter for timestamp when this entry has been created
+        * <p>
+        * @return Timestamp when this entry has been created
+        */
+       Date getEmployeeCreated ();
+
+       /**
+        * Setter for timestamp when this entry has been created
+        * <p>
+        * @param employeeCreated Timestamp when this entry has been created
+        */
+       void setEmployeeCreated (final Date employeeCreated);
+
+       @Override
+       boolean equals (final Object object);
+
+       @Override
+       int hashCode ();
+}
diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/Employee.java b/src/org/mxchange/jcontactsbusiness/model/employee/Employee.java
deleted file mode 100644 (file)
index 965573c..0000000
+++ /dev/null
@@ -1,224 +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.model.employee;
-
-import java.io.Serializable;
-import java.util.Date;
-import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
-import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A POJI for employees
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface Employee extends Serializable {
-
-       /**
-        * Getter for employee's branch office
-        * <p>
-        * @return Employee's branch office
-        */
-       BranchOffice getEmployeeBranchOffice ();
-
-       /**
-        * Setter for employee's branch office
-        * <p>
-        * @param employeeBranchOffice Employee's branch office
-        */
-       void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice);
-
-       /**
-        * Getter for employee's company
-        * <p>
-        * @return Company instance
-        */
-       BusinessBasicData getEmployeeCompany ();
-
-       /**
-        * Setter for employee's company
-        * <p>
-        * @param employeeCompany Company instance
-        */
-       void setEmployeeCompany (final BusinessBasicData employeeCompany);
-
-       /**
-        * Getter for employee's department
-        * <p>
-        * @return Employee's department
-        */
-       Department getEmployeeDepartment ();
-
-       /**
-        * Setter for employee's department
-        * <p>
-        * @param employeeDepartment Employee's department
-        */
-       void setEmployeeDepartment (final Department employeeDepartment);
-
-       /**
-        * Getter for employee's head quarters
-        * <p>
-        * @return Employee's head quarters
-        */
-       HeadquartersData getEmployeeHeadquarter ();
-
-       /**
-        * Getter for employee's head quarters
-        * <p>
-        * @param employeeHeadquarter Employee's head quarters
-        */
-       void setEmployeeHeadquarter (final HeadquartersData employeeHeadquarter);
-
-       /**
-        * Getter for employee's email address
-        * <p>
-        * @return Employee's email address
-        */
-       String getEmployeeEmailAddress ();
-
-       /**
-        * Setter for employee's email address
-        * <p>
-        * @param employeeEmailAddress Employee's email address
-        */
-       void setEmployeeEmailAddress (final String employeeEmailAddress);
-
-       /**
-        * Getter for employee's id number
-        * <p>
-        * @return Employee's id number
-        */
-       Long getEmployeeId ();
-
-       /**
-        * Setter for employee's id number
-        * <p>
-        * @param employeeId Employee's id number
-        */
-       void setEmployeeId (final Long employeeId);
-
-       /**
-        * Getter for employee's mobile number
-        * <p>
-        * @return Employee's mobile number
-        */
-       DialableMobileNumber getEmployeeMobileNumber ();
-
-       /**
-        * Setter for employee's mobile number
-        * <p>
-        * @param employeeMobileNumber Employee's mobile number
-        */
-       void setEmployeeMobileNumber (final DialableMobileNumber employeeMobileNumber);
-
-       /**
-        * Getter for employee's number
-        * <p>
-        * @return Employee's number
-        */
-       String getEmployeeNumber ();
-
-       /**
-        * Setter for employee's number
-        * <p>
-        * @param employeeNumber Employee's number
-        */
-       void setEmployeeNumber (final String employeeNumber);
-
-       /**
-        * Getter for employee's personal data
-        * <p>
-        * @return Employee's personal data
-        */
-       Contact getEmployeePersonalData ();
-
-       /**
-        * Setter for employee's personal data
-        * <p>
-        * @param employeePersonalData Employee's personal data
-        */
-       void setEmployeePersonalData (final Contact employeePersonalData);
-
-       /**
-        * Getter for employee's phone number/extension
-        * <p>
-        * @return Employee's phone number/extension
-        */
-       Integer getEmployeePhoneExtension ();
-
-       /**
-        * Setter for employee's phone number/extension
-        * <p>
-        * @param employeePhoneExtension Employee's phone number/extension
-        */
-       void setEmployeePhoneExtension (final Integer employeePhoneExtension);
-
-       /**
-        * Getter for employee's position
-        * <p>
-        * @return Employee's position
-        */
-       JobPosition getEmployeePosition ();
-
-       /**
-        * Setter for employee's position
-        * <p>
-        * @param employeePosition Employee's position
-        */
-       void setEmployeePosition (final JobPosition employeePosition);
-
-       /**
-        * Getter for user owner instance
-        * <p>
-        * @return User owner instance
-        */
-       User getEmployeeUserOwner ();
-
-       /**
-        * Setter for user owner instance
-        * <p>
-        * @param employeeUserOwner User owner instance
-        */
-       void setEmployeeUserOwner (final User employeeUserOwner);
-
-       /**
-        * Getter for timestamp when this entry has been created
-        * <p>
-        * @return Timestamp when this entry has been created
-        */
-       Date getEmployeeCreated ();
-
-       /**
-        * Setter for timestamp when this entry has been created
-        * <p>
-        * @param employeeCreated Timestamp when this entry has been created
-        */
-       void setEmployeeCreated (final Date employeeCreated);
-
-       @Override
-       boolean equals (final Object object);
-
-       @Override
-       int hashCode ();
-}