source: src/main/java/com/project/beautycenter/model/Ocena.java

Last change on this file was 850b344, checked in by Tamara Simikj <tamara.simic12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
1package com.project.beautycenter.model;
2
3import org.hibernate.annotations.OnDelete;
4import org.hibernate.annotations.OnDeleteAction;
5
6import javax.persistence.*;
7import java.util.List;
8
9@Entity
10@Table(name = "ocena", schema = "project")
11public class Ocena {
12 @Id
13 @GeneratedValue(strategy = GenerationType.IDENTITY)
14 @Column(name = "ocena_id", nullable = false)
15 private Integer id;
16
17 @Column(name = "vrednost", nullable = false)
18 private Integer vrednost;
19
20 @Column(name = "komentar", length = 200)
21 private String komentar;
22
23 @ManyToOne(fetch = FetchType.LAZY)
24 @JoinColumn(name = "user_id_klient")
25 private Klienti klienti;
26
27 @ManyToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.ALL)
28 @JoinColumn(name = "usluga_id", nullable = false)
29 private Uslugi uslugi;
30
31 @ManyToOne(fetch = FetchType.LAZY)
32 @JoinColumn(name = "br_rez")
33 private Rezervacija rezervacija;
34
35
36
37 public Rezervacija getRezervacija() {
38 return rezervacija;
39 }
40
41 public void setRezervacija(Rezervacija rezervacija) {
42 this.rezervacija = rezervacija;
43 }
44
45
46 public Ocena(Integer vrednost, String komentar, Uslugi usluga, Klienti klient) {
47 this.vrednost = vrednost;
48 this.komentar = komentar;
49 this.uslugi = usluga;
50 this.klienti = klient;
51 }
52 public Ocena(){}
53
54 public Ocena(Rezervacija brRez, Uslugi usluga, Integer vrednost, String komentar, Klienti klient) {
55 this.rezervacija = brRez;
56 this.uslugi = usluga;
57 this.vrednost = vrednost;
58 this.komentar = komentar;
59 this.klienti = klient;
60 }
61 public Uslugi getUslugi() {
62 return uslugi;
63 }
64
65 public void setUslugi(Uslugi uslugi) {
66 this.uslugi = uslugi;
67 }
68
69 public Klienti getKlienti() {
70 return klienti;
71 }
72
73 public void setKlienti(Klienti klienti) {
74 this.klienti = klienti;
75 }
76
77 public String getKomentar() {
78 return komentar;
79 }
80
81 public void setKomentar(String komentar) {
82 this.komentar = komentar;
83 }
84
85 public Integer getVrednost() {
86 return vrednost;
87 }
88
89 public void setVrednost(Integer vrednost) {
90 this.vrednost = vrednost;
91 }
92
93 public Integer getId() {
94 return id;
95 }
96
97 public void setId(Integer id) {
98 this.id = id;
99 }
100}
Note: See TracBrowser for help on using the repository browser.