source: src/main/java/com/example/task/entity/TaskEntity.java

Last change on this file was fdfbdde, checked in by Stojilkova Sara <sara.stojilkova.students.finki.ukim.mk>, 9 months ago

Initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1package com.example.task.entity;
2
3import jakarta.persistence.*;
4import lombok.AllArgsConstructor;
5import lombok.Getter;
6import lombok.NoArgsConstructor;
7import lombok.Setter;
8
9import java.time.LocalDate;
10import java.util.List;
11
12@Entity
13@Table(name = "task", schema = "project")
14@NoArgsConstructor
15@AllArgsConstructor
16@Getter
17@Setter
18public 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}
Note: See TracBrowser for help on using the repository browser.