diff --git a/src/main/java/com/pfa/pack/models/entities/Department.java b/src/main/java/com/pfa/pack/models/entities/Department.java index 404fea6..edea802 100644 --- a/src/main/java/com/pfa/pack/models/entities/Department.java +++ b/src/main/java/com/pfa/pack/models/entities/Department.java @@ -4,8 +4,10 @@ import java.util.Collections; import java.util.Set; +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; @@ -39,7 +41,7 @@ public final class Department implements Serializable { private Location location; @JsonIgnore - @OneToMany(mappedBy = "department") + @OneToMany(mappedBy = "department", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private Set employees; public Department() { diff --git a/src/main/resources/templates/admins/departments/admin-departments-list.html b/src/main/resources/templates/admins/departments/admin-departments-list.html index 59100f0..7dd0733 100644 --- a/src/main/resources/templates/admins/departments/admin-departments-list.html +++ b/src/main/resources/templates/admins/departments/admin-departments-list.html @@ -35,7 +35,7 @@

No Records yet!

Edit - Delete + Delete