From: Roland Haeder Date: Mon, 12 Oct 2015 11:48:39 +0000 (+0200) Subject: Rewrite: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2cd03b0e9dde8b73b3b85ec3d305b5ba896c7400;p=jcontacts-business-core.git Rewrite: - made country transient as this one should not be entered by the user - updated jar(s) Signed-off-by:Roland Häder --- diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index b977044..4975e08 100644 Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ diff --git a/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java b/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java index 57cbf71..93206fb 100644 --- a/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java @@ -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 { * 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 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 diff --git a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java index a21dfdc..61e09c1 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java @@ -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'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'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) { diff --git a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java index 3c76923..2114443 100644 --- a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java +++ b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java @@ -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