-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.java
More file actions
91 lines (61 loc) · 1.71 KB
/
Copy pathtask.java
File metadata and controls
91 lines (61 loc) · 1.71 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#This file contains the code for the attributes of the task.
package openin.assignment.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.util.Date;
@Entity
@Table(name = "tasks")
public class task {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank
private String title;
@NotBlank
private String description;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "due_date")
private Date dueDate;
public Task() {
}
public Task(String title, String description, Date dueDate) {
this.title = title;
this.description = description;
this.dueDate = dueDate;
}
// Getters and setters
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
@Override
public String toString() {
return "Task{" +
"id=" + id +
", title='" + title + '\'' +
", description='" + description + '\'' +
", dueDate=" + dueDate +
'}';
}
}