-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathTask.java
More file actions
51 lines (45 loc) · 1.43 KB
/
Task.java
File metadata and controls
51 lines (45 loc) · 1.43 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
48
49
50
51
package com.accenture.codingtest.springbootcodingtest.entity;
import com.accenture.codingtest.springbootcodingtest.util.TaskStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.UUID;
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "task")
public class Task {
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Type(type = "uuid-char")
private UUID id;
@Column(nullable = false)
private String title;
private String description;
@Enumerated(EnumType.STRING)
private TaskStatus status = TaskStatus.NOT_STARTED;
@ManyToOne
@JoinColumn(name = "project_id", nullable = false)
private Project project;
@ManyToOne
@JoinColumn(name = "user_id", nullable = false)
private User user;
public Task(String title, String description, TaskStatus status, Project project, User user) {
this.title = title;
this.description = description;
this.status = status;
this.project = project;
this.user = user;
}
public Task(String title, String description, Project project, User user) {
this.title = title;
this.description = description;
this.project = project;
this.user = user;
}
}