1 | package com.example.eatys_app.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 |
|
---|
5 | import java.sql.Timestamp;
|
---|
6 | import java.util.Date;
|
---|
7 |
|
---|
8 | @Entity
|
---|
9 | @Table(name = "rezervacija", schema = "project")
|
---|
10 | public class Rezervacija {
|
---|
11 |
|
---|
12 | @Id
|
---|
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
14 | @Column(name = "rezervacija_id", nullable = false)
|
---|
15 | private Integer id;
|
---|
16 |
|
---|
17 | @Column(name = "rezervacija_vreme", nullable = false)
|
---|
18 | private Date vreme;
|
---|
19 |
|
---|
20 | @Column(name = "br_lugje", nullable = false)
|
---|
21 | private Integer lugje;
|
---|
22 |
|
---|
23 | @Column(name = "rezervacija_status", nullable = false, length = 50)
|
---|
24 | private String status;
|
---|
25 |
|
---|
26 | @Column(name = "rezervacija_opis", nullable = false, length = 10000)
|
---|
27 | private String opis;
|
---|
28 |
|
---|
29 | @OneToOne
|
---|
30 | @JoinColumn(name = "restoran_id")
|
---|
31 | private Restoran restoran;
|
---|
32 |
|
---|
33 | @ManyToOne(fetch = FetchType.LAZY)
|
---|
34 | @JoinColumn(name = "user_id")
|
---|
35 | private Kupuvac kupuvac;
|
---|
36 |
|
---|
37 | public Rezervacija() {
|
---|
38 | }
|
---|
39 |
|
---|
40 | public Rezervacija(Date vreme, Integer lugje, String status, String opis, Restoran restoran, Kupuvac kupuvac) {
|
---|
41 | this.vreme = vreme;
|
---|
42 | this.lugje = lugje;
|
---|
43 | this.status = status;
|
---|
44 | this.opis = opis;
|
---|
45 | this.restoran = restoran;
|
---|
46 | this.kupuvac=kupuvac;
|
---|
47 | }
|
---|
48 |
|
---|
49 | public Integer getId() {
|
---|
50 | return id;
|
---|
51 | }
|
---|
52 |
|
---|
53 | public void setId(Integer id) {
|
---|
54 | this.id = id;
|
---|
55 | }
|
---|
56 |
|
---|
57 | public Date getVreme() {
|
---|
58 | return vreme;
|
---|
59 | }
|
---|
60 |
|
---|
61 | public void setVreme(Date vreme) {
|
---|
62 | this.vreme = vreme;
|
---|
63 | }
|
---|
64 |
|
---|
65 | public Integer getLugje() {
|
---|
66 | return lugje;
|
---|
67 | }
|
---|
68 |
|
---|
69 | public void setLugje(Integer lugje) {
|
---|
70 | this.lugje = lugje;
|
---|
71 | }
|
---|
72 |
|
---|
73 | public String getStatus() {
|
---|
74 | return status;
|
---|
75 | }
|
---|
76 |
|
---|
77 | public void setStatus(String status) {
|
---|
78 | this.status = status;
|
---|
79 | }
|
---|
80 |
|
---|
81 | public String getOpis() {
|
---|
82 | return opis;
|
---|
83 | }
|
---|
84 |
|
---|
85 | public void setOpis(String opis) {
|
---|
86 | this.opis = opis;
|
---|
87 | }
|
---|
88 |
|
---|
89 | public Restoran getRestoran() {
|
---|
90 | return restoran;
|
---|
91 | }
|
---|
92 |
|
---|
93 | public void setRestoran(Restoran restoran) {
|
---|
94 | this.restoran = restoran;
|
---|
95 | }
|
---|
96 |
|
---|
97 | public Kupuvac getKupuvac() {
|
---|
98 | return kupuvac;
|
---|
99 | }
|
---|
100 |
|
---|
101 | public void setKupuvac(Kupuvac kupuvac) {
|
---|
102 | this.kupuvac = kupuvac;
|
---|
103 | }
|
---|
104 | }
|
---|