main
Last change
on this file since 0078d84 was c03e53b, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 16 months ago |
m-m relations
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[3d3e59d] | 1 | package finki.paw5.model.entities;
|
---|
[d427a07] | 2 |
|
---|
[038c9f7] | 3 | import jakarta.persistence.*;
|
---|
[d427a07] | 4 | import lombok.Data;
|
---|
[fdd7961] | 5 | import lombok.RequiredArgsConstructor;
|
---|
[d427a07] | 6 |
|
---|
[c03e53b] | 7 | import java.util.List;
|
---|
| 8 |
|
---|
[d427a07] | 9 | @Data
|
---|
| 10 | @Entity
|
---|
[fdd7961] | 11 | @RequiredArgsConstructor
|
---|
[d427a07] | 12 | @Table(name = "vet_clinic")
|
---|
| 13 | public class VetClinic {
|
---|
| 14 |
|
---|
| 15 | @Id
|
---|
[038c9f7] | 16 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
[d427a07] | 17 | @Column(name = "id_vet_clinic")
|
---|
[ada7108] | 18 | private Integer id;
|
---|
[d427a07] | 19 |
|
---|
| 20 | @Column(name = "telephone_vet_clinic", nullable = false, length = 20)
|
---|
| 21 | private String telephone;
|
---|
| 22 |
|
---|
| 23 | @Column(name = "address_vet_clinic", nullable = false, length = 100)
|
---|
| 24 | private String address;
|
---|
| 25 |
|
---|
| 26 | @Column(name = "name_vet_clinic", nullable = false, length = 100)
|
---|
| 27 | private String name;
|
---|
| 28 |
|
---|
[c03e53b] | 29 | @ManyToMany
|
---|
| 30 | @JoinTable(name = "pet_needs_intervention_in_vet_clinic",
|
---|
| 31 | joinColumns = @JoinColumn(name = "id_vet_clinic"),
|
---|
| 32 | inverseJoinColumns = @JoinColumn(name = "id_pet"))
|
---|
| 33 | List<Pet> pets;
|
---|
| 34 |
|
---|
[d427a07] | 35 | public VetClinic(String telephone, String address, String name) {
|
---|
| 36 | this.telephone = telephone;
|
---|
| 37 | this.address = address;
|
---|
| 38 | this.name = name;
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.