]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 14 Oct 2017 12:59:58 +0000 (14:59 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 14 Oct 2017 13:04:09 +0000 (15:04 +0200)
- need to change CascadeType to ALL as this should be persisted and all others
- also changed back from ALL to REFRESH as the foreign entities do already exist

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/model/branchoffice/CompanyBranchOffice.java
src/org/mxchange/jcontactsbusiness/model/department/CompanyDepartment.java

index 5db5c8d035501f578285f87751fe748c9857c017..76240d6852e248db27f5e2fd45779a8ee28427f3 100644 (file)
@@ -155,7 +155,7 @@ public class CompanyBranchOffice implements BranchOffice {
         * Opening times for this branch office
         */
        @JoinTable (name = "branch_opening_times", joinColumns = @JoinColumn(name = "branch_opening_id", referencedColumnName = "branch_id"), inverseJoinColumns = @JoinColumn(name = "opening_branch_id", referencedColumnName = "opening_times_id"))
-       @ManyToMany (targetEntity = BusinessOpeningTime.class, cascade = CascadeType.REFRESH)
+       @ManyToMany (targetEntity = BusinessOpeningTime.class, cascade = CascadeType.ALL)
        private List<OpeningTime> branchOpeningTimes;
 
        /**
index be6fd1d69d7dd23a29755e2604b24a8ea5dafda0..892975368e229191478eeb5e22a7d278ca8e5bcf 100644 (file)
@@ -70,14 +70,14 @@ public class CompanyDepartment implements Department {
         * Where this department is located
         */
        @JoinColumn (name = "department_branch_id")
-       @ManyToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL)
+       @ManyToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.REFRESH)
        private BranchOffice departmentBranchOffice;
 
        /**
         * Connection to company contact
         */
        @JoinColumn (name = "department_company_id", nullable = false, updatable = false)
-       @ManyToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.ALL, optional = false)
+       @ManyToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.REFRESH, optional = false)
        private BusinessBasicData departmentCompany;
 
        /**
@@ -92,7 +92,7 @@ public class CompanyDepartment implements Department {
         * Where this department is located
         */
        @JoinColumn (name = "department_headquarters_id")
-       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.ALL)
+       @OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.REFRESH)
        private HeadquartersData departmentHeadquarters;
 
        /**
@@ -114,7 +114,7 @@ public class CompanyDepartment implements Department {
         * Department lead employee
         */
        @JoinColumn (name = "department_lead_id")
-       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
+       @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
        private Employee departmentLead;
 
        /**