Changeset c03e53b


Ignore:
Timestamp:
03/08/23 17:29:07 (21 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
e76c5a6
Parents:
d1fe9c2
Message:

m-m relations

Location:
Prototype Application/Paw5/src/main/java/finki/paw5/model/entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Category.java

    rd1fe9c2 rc03e53b  
    44import lombok.Data;
    55import lombok.RequiredArgsConstructor;
     6
     7import java.util.List;
    68
    79@Data
     
    1921    private String name;
    2022
     23    @ManyToMany
     24    @JoinTable(name = "pet_belongs_to_category",
     25            joinColumns = @JoinColumn(name = "id_category"),
     26            inverseJoinColumns = @JoinColumn(name = "id_pet"))
     27    List<Pet> pets;
     28
    2129    public Category(String name) {
    2230        this.name = name;
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Donor.java

    rd1fe9c2 rc03e53b  
    66
    77import java.time.LocalDate;
     8import java.util.List;
    89
    910@Data
     
    2021    private String organisationName;
    2122
     23    @ManyToMany
     24    @JoinTable(name = "donor_donates_to_organisation",
     25            joinColumns = @JoinColumn(name = "id_user"),
     26            inverseJoinColumns = @JoinColumn(name = "id_organisation"))
     27    List<Organisation> donatedToOrganisations;
     28
    2229    public Donor(LocalDate dateCreated, String name, String email,
    2330                 String password, String telephone, Boolean fromOrganisation,
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Food.java

    rd1fe9c2 rc03e53b  
    55import lombok.Data;
    66import lombok.RequiredArgsConstructor;
     7
     8import java.util.List;
    79
    810@Data
     
    2628    private FoodType type;
    2729
     30    @ManyToMany
     31    @JoinTable(name = "pet_preferably_eats_food",
     32            joinColumns = @JoinColumn(name = "id_food"),
     33            inverseJoinColumns = @JoinColumn(name = "id_pet"))
     34    List<Pet> pets;
     35
    2836    public Food(String manufacturer, String name, FoodType type) {
    2937        this.manufacturer = manufacturer;
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Organisation.java

    rd1fe9c2 rc03e53b  
    44import lombok.Data;
    55import lombok.RequiredArgsConstructor;
     6
     7import java.util.List;
    68
    79@Data
     
    2527    private String billingInformation;
    2628
     29    @ManyToMany
     30    @JoinTable(name = "donor_donates_to_organisation",
     31            joinColumns = @JoinColumn(name = "id_organisation"),
     32            inverseJoinColumns = @JoinColumn(name = "id_user"))
     33    List<Donor> donors;
     34
    2735    public Organisation(String name, String email, String billingInformation) {
    2836        this.name = name;
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Pet.java

    rd1fe9c2 rc03e53b  
    88import lombok.Data;
    99import lombok.RequiredArgsConstructor;
     10
     11import java.util.List;
    1012
    1113@Data
     
    5254    private Shelter shelter;
    5355
     56    @ManyToMany
     57    @JoinTable(name = "pet_belongs_to_category",
     58            joinColumns = @JoinColumn(name = "id_pet"),
     59            inverseJoinColumns = @JoinColumn(name = "id_category"))
     60    List<Category> categories;
     61
     62    @ManyToMany
     63    @JoinTable(name = "pet_needs_intervention_in_vet_clinic",
     64            joinColumns = @JoinColumn(name = "id_pet"),
     65            inverseJoinColumns = @JoinColumn(name = "id_vet_clinic"))
     66    List<VetClinic> vetClinicsTreatedIn;
     67
     68    @ManyToMany
     69    @JoinTable(name = "pet_needs_therapy",
     70            joinColumns = @JoinColumn(name = "id_pet"),
     71            inverseJoinColumns = @JoinColumn(name = "id_therapy"))
     72    List<Therapy> therapies;
     73
     74    @ManyToMany
     75    @JoinTable(name = "pet_preferably_eats_food",
     76            joinColumns = @JoinColumn(name = "id_pet"),
     77            inverseJoinColumns = @JoinColumn(name = "id_food"))
     78    List<Food> preferredFoods;
     79
    5480    public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed,
    5581               String name, Species species, Gender gender, Boolean canBeFostered,
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Therapy.java

    rd1fe9c2 rc03e53b  
    77import java.time.LocalDate;
    88import java.util.Date;
     9import java.util.List;
    910
    1011@Data
     
    2829    private LocalDate endDate;
    2930
     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
    3037    public Therapy(String healthProblem, LocalDate startDate, LocalDate endDate) {
    3138        this.healthProblem = healthProblem;
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/VetClinic.java

    rd1fe9c2 rc03e53b  
    44import lombok.Data;
    55import lombok.RequiredArgsConstructor;
     6
     7import java.util.List;
    68
    79@Data
     
    2527    private String name;
    2628
     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
    2735    public VetClinic(String telephone, String address, String name) {
    2836        this.telephone = telephone;
Note: See TracChangeset for help on using the changeset viewer.