main
Last change
on this file since c049fd6 was c049fd6, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 13 months ago |
specify project schema in the backend
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | package finki.paw5.model.entities;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.Data;
|
---|
5 | import lombok.RequiredArgsConstructor;
|
---|
6 |
|
---|
7 | import java.time.LocalDate;
|
---|
8 | import java.util.Date;
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Data
|
---|
12 | @Entity
|
---|
13 | @RequiredArgsConstructor
|
---|
14 | @Table(name = "therapy", schema = "project")
|
---|
15 | public class Therapy {
|
---|
16 |
|
---|
17 | @Id
|
---|
18 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
19 | @Column(name = "id_therapy")
|
---|
20 | private Integer id;
|
---|
21 |
|
---|
22 | @Column(name = "health_problem", nullable = false, length = 100)
|
---|
23 | private String healthProblem;
|
---|
24 |
|
---|
25 | @Column(name = "start_date")
|
---|
26 | private LocalDate startDate;
|
---|
27 |
|
---|
28 | @Column(name = "end_date")
|
---|
29 | private LocalDate endDate;
|
---|
30 |
|
---|
31 | @ManyToMany
|
---|
32 | @JoinTable(name = "pet_needs_therapy",
|
---|
33 | joinColumns = @JoinColumn(name = "id_therapy"),
|
---|
34 | inverseJoinColumns = @JoinColumn(name = "id_pet"))
|
---|
35 | List<Pet> pets;
|
---|
36 |
|
---|
37 | public Therapy(String healthProblem, LocalDate startDate, LocalDate endDate) {
|
---|
38 | this.healthProblem = healthProblem;
|
---|
39 | this.startDate = startDate;
|
---|
40 | this.endDate = endDate;
|
---|
41 | }
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.