]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Rewrite:
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 11:48:39 +0000 (13:48 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 11:48:39 +0000 (13:48 +0200)
- made country transient as this one should not be entered by the user
- updated jar(s)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcontacts-core.jar
src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java
src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java
src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java
src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java

index b977044176df140d0a842f3cd87d2d9913325158..4975e08ca97c5ffeabb55432319d723655f1f73a 100644 (file)
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
index 57cbf719ffe74a19ff6a4aea3461c132701b0c9d..93206fb4d76cd5e6c319e834ff6613be371851e8 100644 (file)
@@ -20,13 +20,13 @@ import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@@ -58,9 +58,8 @@ 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)
-       @Transient
-       private Country branchCountry;
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
+       private transient Country branchCountry;
 
        /**
         * Branch office's main email address (example: branch-name@company.com)
index 8299bb45bd5baab1d777a35bf2f2ee5a4ff1bbfd..77ed6d0f3d527c1807657a23f105b28066e9911e 100644 (file)
@@ -20,6 +20,7 @@ import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
@@ -27,7 +28,6 @@ import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcontactsbusiness.BusinessContact;
 import org.mxchange.jcontactsbusiness.CompanyContact;
 import org.mxchange.jcontactsbusiness.employee.CompanyEmployee;
@@ -51,9 +51,8 @@ public class CompanyDepartment implements Department, Comparable<Department> {
         * Connection to company contact
         */
        @JoinColumn (name = "department_company_id", nullable = false, updatable = false)
-       @ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false)
-       @Transient
-       private BusinessContact departmentCompany;
+       @ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
+       private transient BusinessContact departmentCompany;
 
        /**
         * Id number
@@ -67,9 +66,8 @@ public class CompanyDepartment implements Department, Comparable<Department> {
         * Department lead employee
         */
        @JoinColumn (name = "department_lead_id", nullable = false)
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
-       @Transient
-       private Employee departmentLead;
+       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+       private transient Employee departmentLead;
 
        /**
         * Department name
index a21dfdc29f8e81a549d06d507986ca9d4de87b5e..61e09c15eb026d782133734359d9cd2de8ae5c74 100644 (file)
@@ -19,13 +19,13 @@ package org.mxchange.jcontactsbusiness.employee;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.UserContact;
 import org.mxchange.jcontactsbusiness.branch.BranchOffice;
@@ -96,9 +96,8 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
         * Employee's personal data
         */
        @JoinColumn (name = "employee_personal_data_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL, optional = false)
-       @Transient
-       private Contact employeePersonalData;
+       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
+       private transient Contact employeePersonalData;
 
        /**
         * Employee's phone extension (or number if different)
@@ -110,9 +109,8 @@ public class CompanyEmployee implements Employee, Comparable<Employee> {
         * Employee's position (example: CEO)
         */
        @JoinColumn (name = "employee_position_id")
-       @OneToOne (targetEntity = EmployeePosition.class, cascade = CascadeType.ALL)
-       @Transient
-       private JobPosition employeePosition;
+       @OneToOne (targetEntity = EmployeePosition.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+       private transient JobPosition employeePosition;
 
        @Override
        public int compareTo (final Employee employee) {
index 3c7692397a936f858c2ebe176b1ec918e38d2c67..21144431b9ac70d4b3b0dd4fcddee2f0b3d2721d 100644 (file)
@@ -20,13 +20,13 @@ import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.persistence.Transient;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountryData;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@@ -59,9 +59,8 @@ 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)
-       @Transient
-       private Country headquartersCountry;
+       @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
+       private transient Country headquartersCountry;
 
        /**
         * Headquarters' fax number