]> git.mxchange.org Git - jcontacts-business-core.git/blobdiff - src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java
Rewrite:
[jcontacts-business-core.git] / src / org / mxchange / jcontactsbusiness / employee / CompanyEmployee.java
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) {