source: src/main/java/com/project/beautycenter/model/Klienti.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.8 KB
Line 
1package com.project.beautycenter.model;
2
3import javax.persistence.*;
4import java.util.LinkedHashSet;
5import java.util.Set;
6
7@Entity
8@Table(name = "klienti",schema = "project")
9public class Klienti {
10 @Id
11 @Column(name = "user_id", nullable = false)
12 private Integer id;
13
14 @MapsId
15 @OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY, optional = false)
16 @JoinColumn(name = "user_id", nullable = false)
17 private Users users;
18
19 @Column(name = "ime", nullable = false, length = 100)
20 private String ime;
21
22 @Column(name = "prezime", length = 100)
23 private String prezime;
24
25 @Column(name = "tel_br", nullable = false, length = 12)
26 private String telBr;
27
28 @Column(name = "e_mail", length = 150)
29 private String eMail;
30
31 @OneToMany(mappedBy = "klienti")
32 private Set<Rezervacija> rezervacijas = new LinkedHashSet<>();
33
34 @OneToMany(mappedBy = "klienti")
35 private Set<Ocena> ocenas = new LinkedHashSet<>();
36
37 public Set<Ocena> getOcenas() {
38 return ocenas;
39 }
40
41 public void setOcenas(Set<Ocena> ocenas) {
42 this.ocenas = ocenas;
43 }
44
45 public Set<Rezervacija> getRezervacijas() {
46 return rezervacijas;
47 }
48
49 public void setRezervacijas(Set<Rezervacija> rezervacijas) {
50 this.rezervacijas = rezervacijas;
51 }
52
53 public Klienti(){
54 }
55
56 public Klienti(Integer id, Users users, String ime, String prezime, String telBr, String eMail) {
57 this.id = id;
58 this.users = users;
59 this.ime = ime;
60 this.prezime = prezime;
61 this.telBr = telBr;
62 this.eMail = eMail;
63 }
64
65 public Klienti(Integer id, String ime, String prezime, String telBr, String eMail) {
66 this.id = id;
67 this.ime = ime;
68 this.prezime = prezime;
69 this.telBr = telBr;
70 this.eMail = eMail;
71 }
72
73 public Klienti(Users users, String ime, String prezime, String telBr, String eMail) {
74 this.users = users;
75 this.ime = ime;
76 this.prezime = prezime;
77 this.telBr = telBr;
78 this.eMail = eMail;
79 this.id = users.getId();
80 }
81
82 public String getEMail() {
83 return eMail;
84 }
85
86 public void setEMail(String eMail) {
87 this.eMail = eMail;
88 }
89
90 public String getTelBr() {
91 return telBr;
92 }
93
94 public void setTelBr(String telBr) {
95 this.telBr = telBr;
96 }
97
98 public String getPrezime() {
99 return prezime;
100 }
101
102 public void setPrezime(String prezime) {
103 this.prezime = prezime;
104 }
105
106 public String getIme() {
107 return ime;
108 }
109
110 public void setIme(String ime) {
111 this.ime = ime;
112 }
113
114 public Users getUsers() {
115 return users;
116 }
117
118 public void setUsers(Users users) {
119 this.users = users;
120 }
121
122 public Integer getId() {
123 return id;
124 }
125
126 public void setId(Integer id) {
127 this.id = id;
128 }
129}
Note: See TracBrowser for help on using the repository browser.