From 06c883204ad68e5e0d1d5056f39ab69ad2ed6385 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 9 May 2016 12:01:25 +0200 Subject: [PATCH] No, was not working ... :-( --- .../jcontactsbusiness/CompanyContact.java | 6 +++-- .../basicdata/CompanyBasicData.java | 12 ++++++---- .../branch/CompanyBranchOffice.java | 15 ++++++++---- .../department/CompanyDepartment.java | 12 ++++++---- .../employee/CompanyEmployee.java | 24 ++++++++++++------- .../headquarters/CompanyHeadQuartersData.java | 9 ++++--- .../jcontactsbusiness/logo/CompanyLogo.java | 3 ++- 7 files changed, 54 insertions(+), 27 deletions(-) diff --git a/src/org/mxchange/jcontactsbusiness/CompanyContact.java b/src/org/mxchange/jcontactsbusiness/CompanyContact.java index ca28ec5..b542c40 100644 --- a/src/org/mxchange/jcontactsbusiness/CompanyContact.java +++ b/src/org/mxchange/jcontactsbusiness/CompanyContact.java @@ -37,7 +37,9 @@ import org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData; import org.mxchange.jcontactsbusiness.branch.BranchOffice; import org.mxchange.jcontactsbusiness.employee.CompanyEmployee; import org.mxchange.jcontactsbusiness.employee.Employee; +import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData; import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -102,14 +104,14 @@ public class CompanyContact implements BusinessContact { * User owner instance */ @JoinColumn (name = "company_user_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User contactUserOwner; /** * Reference to headquarters data */ @JoinColumn (name = "company_headquarters_data_id", nullable = false, updatable = false) - @OneToOne (targetEntity = HeadQuartersData.class, cascade = CascadeType.ALL, optional = false) + @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL, optional = false) private HeadQuartersData headQuartersData; @Override diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java b/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java index bc2aa3e..38cced0 100644 --- a/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java +++ b/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java @@ -32,8 +32,12 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.mxchange.jcontactsbusiness.logo.BusinessLogo; +import org.mxchange.jcontactsbusiness.logo.CompanyLogo; 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; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -63,7 +67,7 @@ public class CompanyBasicData implements BusinessBasicData { * User owner instance */ @JoinColumn (name = "company_user_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User basicUserOwner; /** @@ -91,7 +95,7 @@ public class CompanyBasicData implements BusinessBasicData { * Company's main fax numbers: +ccxxxxxxxxxx */ @JoinColumn (name = "company_fax_number_id") - @OneToOne (targetEntity = DialableFaxNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) private DialableFaxNumber companyFaxNumber; /** @@ -105,7 +109,7 @@ public class CompanyBasicData implements BusinessBasicData { * Id number of company logo */ @JoinColumn (name = "company_logo_id") - @OneToOne (targetEntity = BusinessLogo.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CompanyLogo.class, cascade = CascadeType.ALL) private BusinessLogo companyLogo; /** @@ -119,7 +123,7 @@ public class CompanyBasicData implements BusinessBasicData { * Company's main phone number: +ccxxxxxxxxxx */ @JoinColumn (name = "company_phone_number_id") - @OneToOne (targetEntity = DialableLandLineNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) private DialableLandLineNumber companyPhoneNumber; /** diff --git a/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java b/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java index 9e1af17..13845d8 100644 --- a/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java +++ b/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java @@ -31,9 +31,14 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.mxchange.jcontactsbusiness.BusinessContact; +import org.mxchange.jcontactsbusiness.CompanyContact; 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; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -62,14 +67,14 @@ public class CompanyBranchOffice implements BranchOffice { * Company that has this branch office */ @JoinColumn (name = "branch_company_id", nullable = false, updatable = false) - @OneToOne (targetEntity = BusinessContact.class, optional = false, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CompanyContact.class, optional = false, cascade = CascadeType.ALL) private BusinessContact branchCompanyContact; /** * Branch office's country code */ @JoinColumn (name = "branch_country_id", nullable = false) - @OneToOne (targetEntity = Country.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false) private Country branchCountry; /** @@ -90,7 +95,7 @@ public class CompanyBranchOffice implements BranchOffice { * Branch office's main fax number: +ccxxxxxxxxxx */ @JoinColumn (name = "branch_fax_number_id") - @OneToOne (targetEntity = DialableFaxNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) private DialableFaxNumber branchFaxNumber; /** @@ -112,7 +117,7 @@ public class CompanyBranchOffice implements BranchOffice { * Branch office's main phone number: +ccxxxxxxxxxx */ @JoinColumn (name = "branch_phone_number_id") - @OneToOne (targetEntity = DialableLandLineNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) private DialableLandLineNumber branchPhoneNumber; /** @@ -138,7 +143,7 @@ public class CompanyBranchOffice implements BranchOffice { * User owner instance */ @JoinColumn (name = "branch_user_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User branchUserOwner; /** diff --git a/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java b/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java index 2e928bf..6d6ed4f 100644 --- a/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java +++ b/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java @@ -32,9 +32,13 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.mxchange.jcontactsbusiness.BusinessContact; +import org.mxchange.jcontactsbusiness.CompanyContact; import org.mxchange.jcontactsbusiness.branch.BranchOffice; +import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice; +import org.mxchange.jcontactsbusiness.employee.CompanyEmployee; import org.mxchange.jcontactsbusiness.employee.Employee; import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -63,14 +67,14 @@ public class CompanyDepartment implements Department { * Where this department is located */ @JoinColumn (name = "department_branch_id") - @ManyToOne (targetEntity = BranchOffice.class, cascade = CascadeType.ALL) + @ManyToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL) private BranchOffice departmentBranchOffice; /** * Connection to company contact */ @JoinColumn (name = "department_company_id", nullable = false, updatable = false) - @ManyToOne (targetEntity = BusinessContact.class, cascade = CascadeType.ALL, optional = false) + @ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false) private BusinessContact departmentCompany; /** @@ -93,7 +97,7 @@ public class CompanyDepartment implements Department { * Department lead employee */ @JoinColumn (name = "department_lead_id", nullable = false) - @OneToOne (targetEntity = Employee.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL) private Employee departmentLead; /** @@ -107,7 +111,7 @@ public class CompanyDepartment implements Department { * User owner instance */ @JoinColumn (name = "department_user_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User departmentUserOwner; @Override diff --git a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java index bc296bb..2a7ed33 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java @@ -31,12 +31,20 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontactsbusiness.BusinessContact; +import org.mxchange.jcontactsbusiness.CompanyContact; import org.mxchange.jcontactsbusiness.branch.BranchOffice; +import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice; +import org.mxchange.jcontactsbusiness.department.CompanyDepartment; import org.mxchange.jcontactsbusiness.department.Department; +import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData; import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData; +import org.mxchange.jcontactsbusiness.jobposition.EmployeePosition; import org.mxchange.jcontactsbusiness.jobposition.JobPosition; +import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber; import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -58,14 +66,14 @@ public class CompanyEmployee implements Employee { * Branch office (if the employee works there) */ @JoinColumn (name = "employee_branch_id") - @OneToOne (targetEntity = BranchOffice.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL) private BranchOffice employeeBranchOffice; /** * Company the employee is working at */ @JoinColumn (name = "employee_company_id", nullable = false, updatable = false) - @OneToOne (targetEntity = BusinessContact.class, cascade = CascadeType.ALL, optional = false) + @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false) private BusinessContact employeeCompany; /** @@ -80,7 +88,7 @@ public class CompanyEmployee implements Employee { * Department the employee works at */ @JoinColumn (name = "employee_department_id") - @OneToOne (targetEntity = Department.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CompanyDepartment.class, cascade = CascadeType.ALL) private Department employeeDepartment; /** @@ -93,7 +101,7 @@ public class CompanyEmployee implements Employee { * Head quarters id number (if the employee works there) */ @JoinColumn (name = "employee_headquarters_id") - @OneToOne (targetEntity = HeadQuartersData.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL) private HeadQuartersData employeeHeadquarter; /** @@ -108,7 +116,7 @@ public class CompanyEmployee implements Employee { * Employee's business mobile number */ @JoinColumn (name = "employee_mobile_number_id") - @OneToOne (targetEntity = DialableCellphoneNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL) private DialableCellphoneNumber employeeMobileNumber; /** @@ -121,7 +129,7 @@ public class CompanyEmployee implements Employee { * Employee's personal data */ @JoinColumn (name = "employee_personal_data_id", nullable = false, updatable = false) - @OneToOne (targetEntity = Contact.class, cascade = CascadeType.ALL, optional = false) + @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL, optional = false) private Contact employeePersonalData; /** @@ -134,14 +142,14 @@ public class CompanyEmployee implements Employee { * Employee's position (example: CEO) */ @JoinColumn (name = "employee_position_id") - @OneToOne (targetEntity = JobPosition.class, cascade = CascadeType.REFRESH) + @OneToOne (targetEntity = EmployeePosition.class, cascade = CascadeType.REFRESH) private JobPosition employeePosition; /** * User owner instance */ @JoinColumn (name = "employee_user_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User employeeUserOwner; @Override diff --git a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java index 8b88acf..5c5753b 100644 --- a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java +++ b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java @@ -33,7 +33,10 @@ import javax.persistence.TemporalType; 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; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -77,7 +80,7 @@ public class CompanyHeadQuartersData implements HeadQuartersData { * Headquarters' fax number */ @JoinColumn (name = "headquarters_fax_number_id") - @OneToOne (targetEntity = DialableFaxNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) private DialableFaxNumber headquartersFaxNumber; /** @@ -99,7 +102,7 @@ public class CompanyHeadQuartersData implements HeadQuartersData { * Headquarters' phone number */ @JoinColumn (name = "headquarters_phone_number_id") - @OneToOne (targetEntity = DialableLandLineNumber.class, cascade = CascadeType.ALL) + @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) private DialableLandLineNumber headquartersPhoneNumber; /** @@ -125,7 +128,7 @@ public class CompanyHeadQuartersData implements HeadQuartersData { * User owner instance */ @JoinColumn (name = "headquarters_user_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User headquartersUserOwner; /** diff --git a/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java b/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java index 65407df..439f9f9 100644 --- a/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java +++ b/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java @@ -30,6 +30,7 @@ import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; /** @@ -74,7 +75,7 @@ public class CompanyLogo implements BusinessLogo { * Logo uploader user instance */ @JoinColumn (name = "logo_uploader_id", nullable = false, updatable = false) - @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false) + @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User logoUploader; @Override -- 2.39.5