source: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/VetClinic.java@ c03e53b

main
Last change on this file since c03e53b was c03e53b, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 16 months ago

m-m relations

  • Property mode set to 100644
File size: 1.0 KB
Line 
1package finki.paw5.model.entities;
2
3import jakarta.persistence.*;
4import lombok.Data;
5import lombok.RequiredArgsConstructor;
6
7import java.util.List;
8
9@Data
10@Entity
11@RequiredArgsConstructor
12@Table(name = "vet_clinic")
13public class VetClinic {
14
15 @Id
16 @GeneratedValue(strategy = GenerationType.IDENTITY)
17 @Column(name = "id_vet_clinic")
18 private Integer id;
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
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
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.