- Timestamp:
- 03/09/23 16:11:48 (16 months ago)
- Branches:
- main
- Children:
- 0078d84, 4ab3aae
- Parents:
- 8b7dd7f (diff), 264d675 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- SazdovaEkaterina <74919977+SazdovaEkaterina@…> (03/09/23 16:11:48)
- git-committer:
- GitHub <noreply@…> (03/09/23 16:11:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Pet.java
r8b7dd7f rc3278ac 7 7 import jakarta.persistence.*; 8 8 import lombok.Data; 9 import lombok.RequiredArgsConstructor; 10 11 import java.util.List; 9 12 10 13 @Data 11 14 @Entity 15 @RequiredArgsConstructor 12 16 @Table(name = "pet") 13 17 public class Pet { … … 17 21 @Column(name = "id_pet") 18 22 private Integer id; 23 24 @OneToOne 25 @JoinColumn(name = "id_pet", nullable = false) 26 private PersonalProfile personalProfile; 19 27 20 28 @Column(name = "url_pet_image", length = 200) … … 40 48 41 49 @Column(name = "can_be_fostered", nullable = false) 42 private boolean canBeFostered;50 private Boolean canBeFostered; 43 51 44 @Column(name = "id_adoption") 45 private Integer adoptionId; 52 @ManyToOne 53 @JoinColumn(name = "id_adoption") 54 private Adoption adoption; 46 55 47 @Column(name = "id_shelter") 48 private Integer shelterId; 56 @ManyToOne 57 @JoinColumn(name = "id_shelter") 58 private Shelter shelter; 49 59 50 public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed, String name, Species species, Gender gender, boolean canBeFostered, Integer adoptionId, Integer shelterId) { 60 @ManyToMany 61 @JoinTable(name = "pet_belongs_to_category", 62 joinColumns = @JoinColumn(name = "id_pet"), 63 inverseJoinColumns = @JoinColumn(name = "id_category")) 64 List<Category> categories; 65 66 @ManyToMany 67 @JoinTable(name = "pet_needs_intervention_in_vet_clinic", 68 joinColumns = @JoinColumn(name = "id_pet"), 69 inverseJoinColumns = @JoinColumn(name = "id_vet_clinic")) 70 List<VetClinic> vetClinicsTreatedIn; 71 72 @ManyToMany 73 @JoinTable(name = "pet_needs_therapy", 74 joinColumns = @JoinColumn(name = "id_pet"), 75 inverseJoinColumns = @JoinColumn(name = "id_therapy")) 76 List<Therapy> therapies; 77 78 @ManyToMany 79 @JoinTable(name = "pet_preferably_eats_food", 80 joinColumns = @JoinColumn(name = "id_pet"), 81 inverseJoinColumns = @JoinColumn(name = "id_food")) 82 List<Food> preferredFoods; 83 84 public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed, 85 String name, Species species, Gender gender, Boolean canBeFostered, 86 Adoption adoption, Shelter shelter) { 51 87 this.imageUrl = imageUrl; 52 88 this.ageGroup = ageGroup; … … 57 93 this.gender = gender; 58 94 this.canBeFostered = canBeFostered; 59 this.adoptionId = adoptionId; 60 this.shelterId = shelterId; 61 } 62 63 public Pet() { 95 this.adoption = adoption; 96 this.shelter = shelter; 64 97 } 65 98 }
Note:
See TracChangeset
for help on using the changeset viewer.