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

    r8b7dd7f rc3278ac  
    77import jakarta.persistence.*;
    88import lombok.Data;
     9import lombok.RequiredArgsConstructor;
    910
    1011import java.time.LocalDate;
     
    1314@Entity
    1415@Table(name = "adopter")
     16@RequiredArgsConstructor
    1517@PrimaryKeyJoinColumn(name = "id_user")
    1618public class Adopter extends User {
     
    4042    private Boolean verified;
    4143
    42     @Column(name = "verified_by_employee")
    43     private Integer verifiedByEmployeeId;
     44    @ManyToOne
     45    @JoinColumn(name = "verified_by_employee")
     46    Employee employeeVerificator;
    4447
    4548    public Adopter(LocalDate dateCreated, String name, String email, String password, String telephone,
     
    5760    }
    5861
    59     public Adopter(FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing,
    60                    PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) {
    61         this.freeTime = freeTime;
    62         this.funds = funds;
    63         this.hasOtherPets = hasOtherPets;
    64         this.hasKids = hasKids;
    65         this.housing = housing;
    66         this.physicalActivity = physicalActivity;
    67         this.willFoster = willFoster;
    68         this.verified = verified;
    69         this.verifiedByEmployeeId = verifiedByEmployeeId;
    70     }
    71 
    72     public Adopter() {
    73     }
    7462}
Note: See TracChangeset for help on using the changeset viewer.