source: backend/src/main/java/com/finki/icare/model/Therapist.java

main
Last change on this file was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago

Init

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[700e2f9]1package com.finki.icare.model;
2
3import com.fasterxml.jackson.annotation.JsonIgnore;
4import jakarta.persistence.*;
5import lombok.AllArgsConstructor;
6import lombok.Data;
7import lombok.EqualsAndHashCode;
8import lombok.NoArgsConstructor;
9import org.hibernate.annotations.JdbcTypeCode;
10import org.hibernate.type.SqlTypes;
11
12import java.time.LocalDate;
13import java.util.List;
14
15@Entity
16@Table(name = "therapist")
17@Data
18@NoArgsConstructor
19@AllArgsConstructor
20@EqualsAndHashCode(callSuper = true)
21@PrimaryKeyJoinColumn(name = "id_user")
22public class Therapist extends User {
23
24 @Column(name = "office_location", nullable = false, length = 255)
25 private String officeLocation;
26
27 @Column(name = "degree", nullable = false, length = 100)
28 private String degree;
29
30 @Column(name = "years_exp", nullable = false)
31 private Integer yearsExp;
32
33 @Column(name = "phone_number", nullable = false, length = 20)
34 private String phoneNumber;
35
36 @JdbcTypeCode(SqlTypes.ARRAY)
37 @Column(name = "consultation_slots", columnDefinition = "DATE[]")
38 private LocalDate[] consultationSlots;
39
40 @JsonIgnore
41 @OneToMany(mappedBy = "therapist", cascade = CascadeType.ALL)
42 private List<Patient> patients;
43
44 @JsonIgnore
45 @OneToMany(mappedBy = "therapist", cascade = CascadeType.ALL)
46 private List<Consultation> consultations;
47}
Note: See TracBrowser for help on using the repository browser.