source: src/main/java/com/example/medweb/model/Rezervacija.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: 760 bytes
Line 
1package com.example.medweb.model;
2
3
4import lombok.Data;
5
6import javax.persistence.*;
7
8
9@Data
10@Entity
11public class Rezervacija {
12
13 @Id
14 @GeneratedValue(strategy = GenerationType.IDENTITY)
15 private Integer rezervacija_id;
16
17 @OneToOne
18 @JoinColumn(name = "upat_id", referencedColumnName = "upat_id")
19 private Upat upat;
20
21 @OneToOne
22 @JoinColumns({
23 @JoinColumn(name = "doktor_id", referencedColumnName = "doktor_id"/*, nullable = false*/),
24 @JoinColumn(name = "termin_id", referencedColumnName = "termin_id"/*, nullable = false*/)
25 })
26 private Termin termin;
27
28
29 public Rezervacija() {
30 }
31
32 public Rezervacija(Upat upat, Termin termin) {
33 this.upat = upat;
34 this.termin = termin;
35 }
36
37}
Note: See TracBrowser for help on using the repository browser.