| | |
| | | package kr.wisestone.owl.domain; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.*; |
| | | import java.io.Serializable; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | @Entity |
| | | public class Department extends BaseEntity implements Serializable { |
| | |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | |
| | | @OneToMany(mappedBy = "department", cascade = {CascadeType.ALL}, orphanRemoval = true) |
| | | private Set<ProjectRoleDepartment> projectRoleDepartments = new HashSet<ProjectRoleDepartment>(); |
| | | |
| | | public Department() { |
| | | } |
| | |
| | | public void setDepartmentDescription(String departmentDescription) { |
| | | this.departmentDescription = departmentDescription; |
| | | } |
| | | |
| | | public void addProjectRole(ProjectRole projectRole) { |
| | | if (this.projectRoleDepartments == null) { |
| | | this.projectRoleDepartments = new HashSet<>(); |
| | | } |
| | | ProjectRoleDepartment projectRoleDepartment = new ProjectRoleDepartment(projectRole, this); |
| | | |
| | | this.projectRoleDepartments.add(projectRoleDepartment); |
| | | } |
| | | } |