-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathTask.java
More file actions
47 lines (36 loc) · 1.17 KB
/
Task.java
File metadata and controls
47 lines (36 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.accenture.codingtest.springbootcodingtest.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import lombok.Data;
@Data
@Entity
@Table(name = "task")
public class Task {
@Id
@Column(name = "id", length = 40)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
private String id;
@Column(name = "title", nullable = false)
private String title;
@Column(name = "description", nullable = true)
private String description;
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 40, nullable = false)
private TaskStatusEnum status;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "project_id", nullable = false)
private Project project;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private User user;
}