package org.synyx.urlaubsverwaltung.calendar;

import org.synyx.urlaubsverwaltung.department.Department;

import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotNull;

import static javax.persistence.CascadeType.REMOVE;

@Entity
class DepartmentCalendar extends Calendar {

    @NotNull
    @OneToOne(cascade = REMOVE)
    private Department department;

    public DepartmentCalendar() {
        // for hibernate - do not use this
    }

    DepartmentCalendar(Department department) {
        super();
        this.department = department;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }
}

@@ -217,61 +217,8 @@
 l;%0A%0A
-import static javax.persistence.CascadeType.REMOVE;%0A%0A
 @Ent
@@ -296,26 +296,8 @@
 oOne
-(cascade = REMOVE)
 %0A   

Remove cascade remove