source: Prototype Application/Paw5/src/main/java/finki/paw5/model/Therapy.java@ 579bf6d

main
Last change on this file since 579bf6d was fdfc6fa, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago

change to LocalDate

Date (Java) was incompatible with date (postgresql) because it expected a timestamp type, not date

  • Property mode set to 100644
File size: 827 bytes
Line 
1package finki.paw5.model;
2
3import jakarta.persistence.Column;
4import jakarta.persistence.Entity;
5import jakarta.persistence.Id;
6import jakarta.persistence.Table;
7import lombok.Data;
8
9import java.time.LocalDate;
10import java.util.Date;
11
12@Data
13@Entity
14@Table(name = "therapy")
15public class Therapy {
16
17 @Id
18 @Column(name = "id_therapy")
19 private int id;
20
21 @Column(name = "health_problem", nullable = false, length = 100)
22 private String healthProblem;
23
24 @Column(name = "start_date")
25 private LocalDate startDate;
26
27 @Column(name = "end_date")
28 private LocalDate endDate;
29
30 public Therapy(String healthProblem, LocalDate startDate, LocalDate endDate) {
31 this.healthProblem = healthProblem;
32 this.startDate = startDate;
33 this.endDate = endDate;
34 }
35
36 public Therapy() {
37 }
38}
Note: See TracBrowser for help on using the repository browser.