source: src/main/java/com/example/medweb/model/Upat.java

Last change on this file was e5fefbd, checked in by Anita Terziska <63020646+Nit4e@…>, 2 years ago

initial commit

  • Property mode set to 100644
File size: 1008 bytes
Line 
1package com.example.medweb.model;
2
3
4
5import lombok.Data;
6
7import javax.persistence.*;
8
9
10@Data
11@Entity
12public class Upat {
13
14 @Id
15 @GeneratedValue(strategy = GenerationType.IDENTITY)
16 private Integer upat_id;
17 private String dijagnoza;
18
19 @ManyToOne
20 @JoinColumn(name = "covek_pacient_id", referencedColumnName = "covek_pacient_id", nullable = false)
21 private Pacient pacient;
22
23 @ManyToOne
24 @JoinColumn(name = "pregled_id", referencedColumnName = "pregled_id", nullable = true)
25 private Pregled pregled;
26
27 @ManyToOne
28 @JoinColumns({
29 @JoinColumn(name = "bolnica_id", referencedColumnName = "bolnica_id", nullable = false),
30 @JoinColumn(name = "oddel_id", referencedColumnName = "oddel_id", nullable = false)
31 })
32 private Oddel oddel;
33
34 @OneToOne(mappedBy = "upat")
35 private Rezervacija rezervacija;
36
37 public Upat() {
38 }
39
40 public Upat(String dijagnoza) {
41 this.dijagnoza = dijagnoza;
42 }
43
44 public Upat(Long id) {
45 }
46}
Note: See TracBrowser for help on using the repository browser.