Ignore:
Timestamp:
03/09/23 16:11:48 (16 months ago)
Author:
GitHub <noreply@…>
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)
Message:

Merge pull request #9 from SazdovaEkaterina/fix-foreign-keys

Fix Database Mapping in Models

File:
1 edited

Legend:

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

    r8b7dd7f rc3278ac  
    33import jakarta.persistence.*;
    44import lombok.Data;
     5import lombok.RequiredArgsConstructor;
    56
    67import java.time.LocalDate;
    78import java.util.Date;
     9import java.util.List;
    810
    911@Data
    1012@Entity
     13@RequiredArgsConstructor
    1114@Table(name = "therapy")
    1215public class Therapy {
     
    2629    private LocalDate endDate;
    2730
     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
    2837    public Therapy(String healthProblem, LocalDate startDate, LocalDate endDate) {
    2938        this.healthProblem = healthProblem;
     
    3140        this.endDate = endDate;
    3241    }
    33 
    34     public Therapy() {
    35     }
    3642}
Note: See TracChangeset for help on using the changeset viewer.