]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Also phone, fax and cell phone numbers can now be linked here, too. ;-)
authorRoland Haeder <roland@mxchange.org>
Sat, 10 Oct 2015 21:16:41 +0000 (23:16 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 10 Oct 2015 21:50:16 +0000 (23:50 +0200)
src/org/mxchange/jcontactsbusiness/branch/BranchOffice.java
src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java
src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java
src/org/mxchange/jcontactsbusiness/employee/Employee.java

index b7cde6e042ff7be8cef75d994ba43fa1ce0aea3e..1117f98232e15a98f67a955242a6c5c797b237d5 100644 (file)
@@ -18,6 +18,8 @@ package org.mxchange.jcontactsbusiness.branch;
 
 import java.io.Serializable;
 import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 
 /**
  * A POJI for branch offices
@@ -59,14 +61,14 @@ public interface BranchOffice extends Serializable {
         * <p>
         * @return Branch office's fax number
         */
-       public String getBranchFaxNumber ();
+       public DialableFaxNumber getBranchFaxNumber ();
 
        /**
         * Setter for branch office's fax number
         * <p>
         * @param branchFaxNumber Branch office's fax number
         */
-       public void setBranchFaxNumber (String branchFaxNumber);
+       public void setBranchFaxNumber (final DialableFaxNumber branchFaxNumber);
 
        /**
         * Getter for branch office's house number
@@ -87,14 +89,14 @@ public interface BranchOffice extends Serializable {
         * <p>
         * @return Branch office's phone number
         */
-       public String getBranchPhoneNumber ();
+       public DialableLandLineNumber getBranchPhoneNumber ();
 
        /**
         * Setter for branch office's phone number
         * <p>
         * @param branchPhoneNumber Branch office's phone number
         */
-       public void setBranchPhoneNumber (final String branchPhoneNumber);
+       public void setBranchPhoneNumber (final DialableLandLineNumber branchPhoneNumber);
 
        /**
         * Getter for branch office's store
index 621e353eef91e9fedca38fa52d086c21d92b3fe7..223fe5d468d41fc2d82723724d09be3879e7f257 100644 (file)
@@ -28,6 +28,9 @@ import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
 
 /**
  * A POJO for company branch offices
@@ -95,20 +98,22 @@ public class CompanyBranchOffice implements BranchOffice, Comparable<BranchOffic
         * Branch office's country code
         */
        @JoinColumn (name = "branch_country_id", nullable = false)
-       @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
        private Country branchCountry;
 
        /**
         * Branch office's main phone number: +ccxxxxxxxxxx
         */
-       @Column (name = "branch_phone_number", length = 20)
-       private String branchPhoneNumber;
+       @JoinColumn (name = "branch_phone_number_id")
+       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+       private DialableLandLineNumber branchPhoneNumber;
 
        /**
         * Branch office's main fax number: +ccxxxxxxxxxx
         */
-       @Column (name = "branch_fax_number", length = 20)
-       private String branchFaxNumber;
+       @JoinColumn (name = "branch_fax_number_id")
+       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+       private DialableFaxNumber branchFaxNumber;
 
        /**
         * Branch office's main email address (example: branch-name@company.com)
@@ -152,12 +157,12 @@ public class CompanyBranchOffice implements BranchOffice, Comparable<BranchOffic
        }
 
        @Override
-       public String getBranchFaxNumber () {
+       public DialableFaxNumber getBranchFaxNumber () {
                return this.branchFaxNumber;
        }
 
        @Override
-       public void setBranchFaxNumber (String branchFaxNumber) {
+       public void setBranchFaxNumber (final DialableFaxNumber branchFaxNumber) {
                this.branchFaxNumber = branchFaxNumber;
        }
 
@@ -172,12 +177,12 @@ public class CompanyBranchOffice implements BranchOffice, Comparable<BranchOffic
        }
 
        @Override
-       public String getBranchPhoneNumber () {
+       public DialableLandLineNumber getBranchPhoneNumber () {
                return this.branchPhoneNumber;
        }
 
        @Override
-       public void setBranchPhoneNumber (final String branchPhoneNumber) {
+       public void setBranchPhoneNumber (final DialableLandLineNumber branchPhoneNumber) {
                this.branchPhoneNumber = branchPhoneNumber;
        }
 
index b1fe9933768feb05139f2012a0fec5dd30d6c708..846257e82608e52a99990b726714fcfc7de00a78 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jcontactsbusiness.employee;
 
 import javax.persistence.Basic;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
@@ -31,6 +32,8 @@ import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice;
 import org.mxchange.jcontactsbusiness.department.CompanyDepartment;
 import org.mxchange.jcontactsbusiness.department.Department;
+import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 
 /**
  * A POJO for company employees (including CEO)
@@ -77,8 +80,9 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        /**
         * Employee's business mobile number
         */
-       @Column (name = "employee_mobile_number", length = 20)
-       private String employeeMobileNumber;
+       @JoinColumn (name = "employee_mobile_number_id")
+       @OneToOne(targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL)
+       private DialableCellphoneNumber employeeMobileNumber;
 
        /**
         * Employee's number
@@ -97,8 +101,8 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        /**
         * Employee's phone extension (or number if different)
         */
-       @Column (name = "employee_phone_extension", length = 20)
-       private String employeePhoneExtension;
+       @Column (name = "employee_phone_extension", length = 10)
+       private Integer employeePhoneExtension;
 
        /**
         * Employee's position (example: CEO)
@@ -153,12 +157,12 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        }
 
        @Override
-       public String getEmployeeMobileNumber () {
+       public DialableCellphoneNumber getEmployeeMobileNumber () {
                return this.employeeMobileNumber;
        }
 
        @Override
-       public void setEmployeeMobileNumber (final String employeeMobileNumber) {
+       public void setEmployeeMobileNumber (final DialableCellphoneNumber employeeMobileNumber) {
                this.employeeMobileNumber = employeeMobileNumber;
        }
 
@@ -183,12 +187,12 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
        }
 
        @Override
-       public String getEmployeePhoneExtension () {
+       public Integer getEmployeePhoneExtension () {
                return this.employeePhoneExtension;
        }
 
        @Override
-       public void setEmployeePhoneExtension (final String employeePhoneExtension) {
+       public void setEmployeePhoneExtension (final Integer employeePhoneExtension) {
                this.employeePhoneExtension = employeePhoneExtension;
        }
 
index 04f0aa882641559764524331bb2896e761093e7d..1c14cba2c0ecd2650085c248920c751050ad9276 100644 (file)
@@ -20,6 +20,7 @@ import java.io.Serializable;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
 import org.mxchange.jcontactsbusiness.department.Department;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 
 /**
  * A POJI for employees
@@ -89,14 +90,14 @@ public interface Employee extends Serializable {
         * <p>
         * @return Employee's mobile number
         */
-       public String getEmployeeMobileNumber ();
+       public DialableCellphoneNumber getEmployeeMobileNumber ();
 
        /**
         * Setter for employee's mobile number
         * <p>
         * @param employeeMobileNumber Employee's mobile number
         */
-       public void setEmployeeMobileNumber (final String employeeMobileNumber);
+       public void setEmployeeMobileNumber (final DialableCellphoneNumber employeeMobileNumber);
 
        /**
         * Getter for employee's number
@@ -131,14 +132,14 @@ public interface Employee extends Serializable {
         * <p>
         * @return Employee's phone number/extension
         */
-       public String getEmployeePhoneExtension ();
+       public Integer getEmployeePhoneExtension ();
 
        /**
         * Setter for employee's phone number/extension
         * <p>
         * @param employeePhoneExtension Employee's phone number/extension
         */
-       public void setEmployeePhoneExtension (final String employeePhoneExtension);
+       public void setEmployeePhoneExtension (final Integer employeePhoneExtension);
 
        /**
         * Getter for employee's position