* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**