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;
* Company's main fax numbers: +ccxxxxxxxxxx
*/
@JoinColumn (name = "company_fax_number_id")
- @OneToMany (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
+ @OneToMany (targetEntity = FaxNumber.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private List<DialableFaxNumber> companyFaxNumberList;
/**
* Company's main phone number: +ccxxxxxxxxxx
*/
@JoinColumn (name = "company_phone_number")
- @OneToMany (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
+ @OneToMany (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private List<DialableLandLineNumber> companyPhoneNumber;
/**
*/
@JoinColumn (name = "branch_country_id", nullable = false)
@OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
- private transient Country branchCountry;
+ private Country branchCountry;
/**
* Branch office's main email address (example: branch-name@company.com)
*/
@JoinColumn (name = "department_company_id", nullable = false, updatable = false)
@ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
- private transient BusinessContact departmentCompany;
+ private BusinessContact departmentCompany;
/**
* Id number
*/
@JoinColumn (name = "department_lead_id", nullable = false)
@OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- private transient Employee departmentLead;
+ private Employee departmentLead;
/**
* Department name
*/
@JoinColumn (name = "employee_personal_data_id", nullable = false, updatable = false)
@OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
- private transient Contact employeePersonalData;
+ private Contact employeePersonalData;
/**
* Employee's phone extension (or number if different)
*/
@JoinColumn (name = "employee_position_id")
@OneToOne (targetEntity = EmployeePosition.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- private transient JobPosition employeePosition;
+ private JobPosition employeePosition;
@Override
public int compareTo (final Employee employee) {
*/
@JoinColumn (name = "headquarters_country_id", nullable = false)
@OneToOne (targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
- private transient Country headquartersCountry;
+ private Country headquartersCountry;
/**
* Headquarters' fax number