source: src/main/java/com/project/beautycenter/model/Vraboteni.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: 3.7 KB
Line 
1package com.project.beautycenter.model;
2
3import javax.persistence.*;
4import java.time.Instant;
5import java.util.LinkedHashSet;
6import java.util.Set;
7
8@Entity
9@Table(name = "vraboteni",schema = "project")
10public class Vraboteni {
11 @Id
12 @Column(name = "user_id", nullable = false)
13 private Integer id;
14
15 @MapsId
16 @OneToOne(cascade = CascadeType.MERGE,fetch = FetchType.LAZY, optional = false)
17 @JoinColumn(name = "user_id", nullable = false)
18 private Users users;
19
20 @Column(name = "first_name", nullable = false, length = 100)
21 private String firstName;
22
23 @Column(name = "middle_name", length = 100)
24 private String middleName;
25
26 @Column(name = "prezime", length = 100)
27 private String prezime;
28
29 @Column(name = "e_mail", nullable = false, length = 100)
30 private String eMail;
31
32 @Column(name = "tel_br", length = 12)
33 private String telBr;
34
35 @Column(name = "rab_iskustvo")
36 private Integer rabIskustvo;
37
38 @OneToMany(mappedBy = "vraboteni")
39 private Set<Termini> termini = new LinkedHashSet<>();
40
41
42 @ManyToOne(fetch = FetchType.LAZY, optional = false)
43 @JoinColumn(name = "salon_id", nullable = false)
44 private Beautycenter beautycenter;
45
46 @Column(name = "raboti_od", nullable = false)
47 private Instant rabotiOd;
48
49 @Column(name = "raboti_do")
50 private Instant rabotiDo;
51
52 public Vraboteni(){}
53
54 public Vraboteni(Users users, String ime,String middleName, String prezime, String telBr, String eMail,
55 Integer rabIskustvo, Instant rabotiOd,Beautycenter beautycenter) {
56 this.users = users;
57 this.id = users.getId();
58 this.firstName = ime;
59 this.middleName = middleName;
60 this.prezime = prezime;
61 this.telBr = telBr;
62 this.eMail = eMail;
63 this.rabIskustvo = rabIskustvo;
64 this.rabotiOd = rabotiOd;
65 this.beautycenter = beautycenter;
66
67 }
68
69 public Instant getRabotiDo() {
70 return rabotiDo;
71 }
72
73 public void setRabotiDo(Instant rabotiDo) {
74 this.rabotiDo = rabotiDo;
75 }
76
77 public Instant getRabotiOd() {
78 return rabotiOd;
79 }
80
81 public void setRabotiOd(Instant rabotiOd) {
82 this.rabotiOd = rabotiOd;
83 }
84
85 public Beautycenter getBeautycenter() {
86 return beautycenter;
87 }
88
89 public void setBeautycenter(Beautycenter beautycenter) {
90 this.beautycenter = beautycenter;
91 }
92
93 public Set<Termini> getTermini() {
94 return termini;
95 }
96
97 public void setTermini(Set<Termini> termini) {
98 this.termini = termini;
99 }
100
101 public Integer getRabIskustvo() {
102 return rabIskustvo;
103 }
104
105 public void setRabIskustvo(Integer rabIskustvo) {
106 this.rabIskustvo = rabIskustvo;
107 }
108
109 public String getTelBr() {
110 return telBr;
111 }
112
113 public void setTelBr(String telBr) {
114 this.telBr = telBr;
115 }
116
117 public String getEMail() {
118 return eMail;
119 }
120
121 public void setEMail(String eMail) {
122 this.eMail = eMail;
123 }
124
125 public String getPrezime() {
126 return prezime;
127 }
128
129 public void setPrezime(String prezime) {
130 this.prezime = prezime;
131 }
132
133 public String getMiddleName() {
134 return middleName;
135 }
136
137 public void setMiddleName(String middleName) {
138 this.middleName = middleName;
139 }
140
141 public String getFirstName() {
142 return firstName;
143 }
144
145 public void setFirstName(String firstName) {
146 this.firstName = firstName;
147 }
148
149 public Users getUsers() {
150 return users;
151 }
152
153 public void setUsers(Users users) {
154 this.users = users;
155 }
156
157 public Integer getId() {
158 return id;
159 }
160
161 public void setId(Integer id) {
162 this.id = id;
163 }
164}
Note: See TracBrowser for help on using the repository browser.