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/Shelter.java

    r8b7dd7f rc3278ac  
    33import jakarta.persistence.*;
    44import lombok.Data;
     5import lombok.RequiredArgsConstructor;
    56
    67@Data
    78@Entity
     9@RequiredArgsConstructor
    810@Table(name = "shelter")
    911public class Shelter {
     
    2022    private String telephone;
    2123
    22     @Column(name = "id_organisation")
    23     private Integer organisationId;
     24    @ManyToOne
     25    @JoinColumn(name = "id_organisation")
     26    private Organisation organisation;
    2427
    2528    @Column(name = "name_shelter", nullable = false, length = 100)
     
    2932    private String email;
    3033
    31     public Shelter(String address, String telephone, Integer organisationId, String name, String email) {
     34    public Shelter(String address, String telephone, Organisation organisation,
     35                   String name, String email) {
    3236        this.address = address;
    3337        this.telephone = telephone;
    34         this.organisationId = organisationId;
     38        this.organisation = organisation;
    3539        this.name = name;
    3640        this.email = email;
    3741    }
    38 
    39     public Shelter() {
    40     }
    4142}
Note: See TracChangeset for help on using the changeset viewer.