Ignore:
Timestamp:
02/03/23 10:47:25 (17 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
038c9f7, 1bd0a56, 8ae6217
Parents:
fdfc6fa
Message:

added inheritance

File:
1 edited

Legend:

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

    rfdfc6fa r579bf6d  
    55import finki.paw5.model.enumerations.Housing;
    66import finki.paw5.model.enumerations.PhysicalActivity;
    7 import jakarta.persistence.Column;
    8 import jakarta.persistence.Entity;
    9 import jakarta.persistence.Id;
    10 import jakarta.persistence.Table;
     7import jakarta.persistence.*;
    118import lombok.Data;
     9
     10import java.time.LocalDate;
    1211
    1312@Data
    1413@Entity
    1514@Table(name = "adopter")
    16 public class Adopter {
    17 
    18     @Id
    19     @Column(name = "id_user", nullable = false)
    20     private int id;
     15@PrimaryKeyJoinColumn(name = "id_user")
     16public class Adopter extends User {
    2117
    2218    @Column(name = "free_time")
     
    4743    private int verifiedByEmployeeId;
    4844
    49     public Adopter(int id, FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing, PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) {
    50         this.id = id;
     45    public Adopter(LocalDate dateCreated, String name, String email, String password, String telephone,
     46                   FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing,
     47                   PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) {
     48        super(dateCreated, name, email, password, telephone);
     49        this.freeTime = freeTime;
     50        this.funds = funds;
     51        this.hasOtherPets = hasOtherPets;
     52        this.hasKids = hasKids;
     53        this.housing = housing;
     54        this.physicalActivity = physicalActivity;
     55        this.willFoster = willFoster;
     56        this.verified = verified;
     57        this.verifiedByEmployeeId = verifiedByEmployeeId;
     58    }
     59
     60    public Adopter(FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing,
     61                   PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) {
    5162        this.freeTime = freeTime;
    5263        this.funds = funds;
Note: See TracChangeset for help on using the changeset viewer.