1 | package com.example.task.entity;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.AllArgsConstructor;
|
---|
5 | import lombok.Getter;
|
---|
6 | import lombok.NoArgsConstructor;
|
---|
7 | import lombok.Setter;
|
---|
8 |
|
---|
9 | import java.time.LocalDate;
|
---|
10 | import java.util.List;
|
---|
11 |
|
---|
12 | @Entity
|
---|
13 | @Table(name = "task", schema = "project")
|
---|
14 | @NoArgsConstructor
|
---|
15 | @AllArgsConstructor
|
---|
16 | @Getter
|
---|
17 | @Setter
|
---|
18 | public class TaskEntity {
|
---|
19 |
|
---|
20 | @Id
|
---|
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
22 | @Column(name = "task_id")
|
---|
23 | private Integer id;
|
---|
24 |
|
---|
25 | @Column(name = "task_due_date")
|
---|
26 | private LocalDate dueDate;
|
---|
27 |
|
---|
28 | @Column(name = "task_name")
|
---|
29 | private String name;
|
---|
30 |
|
---|
31 | @Column(name = "task_description")
|
---|
32 | private String description;
|
---|
33 |
|
---|
34 | @Column(name = "task_priority")
|
---|
35 | private Integer priority;
|
---|
36 |
|
---|
37 | @Column(name = "is_done")
|
---|
38 | private boolean isDone;
|
---|
39 |
|
---|
40 | @ManyToOne
|
---|
41 | @JoinColumn(name = "student_id")
|
---|
42 | private StudentEntity student;
|
---|
43 |
|
---|
44 | public TaskEntity(String name, String description, Integer priority, boolean isDone, StudentEntity student) {
|
---|
45 | this.name = name;
|
---|
46 | this.description = description;
|
---|
47 | this.priority = priority;
|
---|
48 | this.isDone = isDone;
|
---|
49 | this.student = student;
|
---|
50 | }
|
---|
51 | public TaskEntity(LocalDate dueDate, String name, String description, Integer priority, boolean isDone, StudentEntity student) {
|
---|
52 | this.dueDate = dueDate;
|
---|
53 | this.name = name;
|
---|
54 | this.description = description;
|
---|
55 | this.priority = priority;
|
---|
56 | this.isDone = isDone;
|
---|
57 | this.student = student;
|
---|
58 | }
|
---|
59 | }
|
---|