]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
added fax and phone number references for headquarters
authorRoland Haeder <roland@mxchange.org>
Sat, 10 Oct 2015 21:21:38 +0000 (23:21 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 10 Oct 2015 21:50:16 +0000 (23:50 +0200)
src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java
src/org/mxchange/jcontactsbusiness/headquarters/HeadQuartersData.java

index bc80e19f449368d56beff7ec57fe51b00d6d669b..aa5479b8834ea2bc19e510b698574664e189d0ca 100644 (file)
@@ -28,6 +28,10 @@ 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.fax.FaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
 
 /**
  * A POJO for company headquarts data
@@ -54,7 +58,7 @@ public class CompanyHeadQuartersData implements HeadQuartersData, Comparable<Hea
         * Headquarter's country code
         */
        @JoinColumn (name = "headquarters_country_id", nullable = false)
-       @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
        private Country headquartersCountry;
 
        /**
@@ -98,6 +102,20 @@ public class CompanyHeadQuartersData implements HeadQuartersData, Comparable<Hea
        @Column (name = "headquarters_zip_code", length = 6, nullable = false)
        private Integer headquartersZipCode;
 
+       /**
+        * Headquarters' phone number
+        */
+       @JoinColumn (name = "headquarters_phone_number_id")
+       @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+       private DialableLandLineNumber headquartersPhoneNumber;
+
+       /**
+        * Headquarters' fax number
+        */
+       @JoinColumn (name = "headquarters_fax_number_id")
+       @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
+       private DialableFaxNumber headquartersFaxNumber;
+
        @Override
        public int compareTo (final HeadQuartersData headQuartersData) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
@@ -182,4 +200,24 @@ public class CompanyHeadQuartersData implements HeadQuartersData, Comparable<Hea
        public void setHeadquartersZipCode (final Integer headquartersZipCode) {
                this.headquartersZipCode = headquartersZipCode;
        }
+
+       @Override
+       public DialableLandLineNumber getHeadquartersPhoneNumber () {
+               return this.headquartersPhoneNumber;
+       }
+
+       @Override
+       public void setHeadquartersPhoneNumber (final DialableLandLineNumber headquartersPhoneNumber) {
+               this.headquartersPhoneNumber = headquartersPhoneNumber;
+       }
+
+       @Override
+       public DialableFaxNumber getHeadquartersFaxNumber () {
+               return this.headquartersFaxNumber;
+       }
+
+       @Override
+       public void setHeadquartersFaxNumber (final DialableFaxNumber headquartersFaxNumber) {
+               this.headquartersFaxNumber = headquartersFaxNumber;
+       }
 }
index 0073062be1920e4a3cd2dbd8384a9415cc000fd1..8d8645bbbe31f5988bb703ff95dfdb35246248b3 100644 (file)
@@ -18,6 +18,8 @@ package org.mxchange.jcontactsbusiness.headquarters;
 
 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 headquarters data
@@ -137,4 +139,32 @@ public interface HeadQuartersData extends Serializable {
         * @param headquartersZipCode Headquarters' ZIP code
         */
        public void setHeadquartersZipCode (final Integer headquartersZipCode);
+
+       /**
+        * Getter for headquarters' phone number
+        * <p>
+        * @return Headquarters' phone number
+        */
+       public DialableLandLineNumber getHeadquartersPhoneNumber ();
+
+       /**
+        * Setter for headquarters' phone number
+        * <p>
+        * @param headquartersPhoneNumber Headquarters' phone number
+        */
+       public void setHeadquartersPhoneNumber (final DialableLandLineNumber headquartersPhoneNumber);
+
+       /**
+        * Getter for headquarters' fax number
+        * <p>
+        * @return Headquarters' fax number
+        */
+       public DialableFaxNumber getHeadquartersFaxNumber ();
+
+       /**
+        * Setter for headquarters' fax number
+        * <p>
+        * @param headquartersFaxNumber Headquarters' fax number
+        */
+       public void setHeadquartersFaxNumber (final DialableFaxNumber headquartersFaxNumber);
 }