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
|
Rev | Line | |
---|
[d427a07] | 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 |
|
---|
[fdfc6fa] | 9 | import java.time.LocalDate;
|
---|
[d427a07] | 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")
|
---|
[fdfc6fa] | 25 | private LocalDate startDate;
|
---|
[d427a07] | 26 |
|
---|
| 27 | @Column(name = "end_date")
|
---|
[fdfc6fa] | 28 | private LocalDate endDate;
|
---|
[d427a07] | 29 |
|
---|
[fdfc6fa] | 30 | public Therapy(String healthProblem, LocalDate startDate, LocalDate endDate) {
|
---|
[d427a07] | 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.