package kr.wisestone.owl.domain; import javax.persistence.*; import java.io.Serializable; import java.util.HashSet; import java.util.Set; /** * Created by wisestone on 2018-01-03. */ @Entity public class Priority extends BaseEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private Integer position; private String color; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "workspace_id") private Workspace workspace; @OneToMany(mappedBy = "priority", cascade = { CascadeType.ALL }, orphanRemoval = true) private Set issues = new HashSet<>(); public Priority() {} public Priority(String name, Integer position, String color, Workspace workspace) { this.name = name; this.position = position; this.color = color; this.workspace = workspace; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getPosition() { return position; } public void setPosition(Integer position) { this.position = position; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public Workspace getWorkspace() { return workspace; } public void setWorkspace(Workspace workspace) { this.workspace = workspace; } public Set getIssues() { return issues; } public void setIssues(Set issues) { this.issues = issues; } }