main
Last change
on this file since a3aea2a 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 | |
---|
1 | package finki.paw5.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.Column;
|
---|
4 | import jakarta.persistence.Entity;
|
---|
5 | import jakarta.persistence.Id;
|
---|
6 | import jakarta.persistence.Table;
|
---|
7 | import lombok.Data;
|
---|
8 |
|
---|
9 | import java.time.LocalDate;
|
---|
10 | import java.util.Date;
|
---|
11 |
|
---|
12 | @Data
|
---|
13 | @Entity
|
---|
14 | @Table(name = "therapy")
|
---|
15 | public 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.