package com.project.beautycenter.model; import javax.persistence.*; import java.time.Instant; import java.util.LinkedHashSet; import java.util.Set; @Entity @Table(name = "vraboteni",schema = "project") public class Vraboteni { @Id @Column(name = "user_id", nullable = false) private Integer id; @MapsId @OneToOne(cascade = CascadeType.MERGE,fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "user_id", nullable = false) private Users users; @Column(name = "first_name", nullable = false, length = 100) private String firstName; @Column(name = "middle_name", length = 100) private String middleName; @Column(name = "prezime", length = 100) private String prezime; @Column(name = "e_mail", nullable = false, length = 100) private String eMail; @Column(name = "tel_br", length = 12) private String telBr; @Column(name = "rab_iskustvo") private Integer rabIskustvo; @OneToMany(mappedBy = "vraboteni") private Set termini = new LinkedHashSet<>(); @ManyToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "salon_id", nullable = false) private Beautycenter beautycenter; @Column(name = "raboti_od", nullable = false) private Instant rabotiOd; @Column(name = "raboti_do") private Instant rabotiDo; public Vraboteni(){} public Vraboteni(Users users, String ime,String middleName, String prezime, String telBr, String eMail, Integer rabIskustvo, Instant rabotiOd,Beautycenter beautycenter) { this.users = users; this.id = users.getId(); this.firstName = ime; this.middleName = middleName; this.prezime = prezime; this.telBr = telBr; this.eMail = eMail; this.rabIskustvo = rabIskustvo; this.rabotiOd = rabotiOd; this.beautycenter = beautycenter; } public Instant getRabotiDo() { return rabotiDo; } public void setRabotiDo(Instant rabotiDo) { this.rabotiDo = rabotiDo; } public Instant getRabotiOd() { return rabotiOd; } public void setRabotiOd(Instant rabotiOd) { this.rabotiOd = rabotiOd; } public Beautycenter getBeautycenter() { return beautycenter; } public void setBeautycenter(Beautycenter beautycenter) { this.beautycenter = beautycenter; } public Set getTermini() { return termini; } public void setTermini(Set termini) { this.termini = termini; } public Integer getRabIskustvo() { return rabIskustvo; } public void setRabIskustvo(Integer rabIskustvo) { this.rabIskustvo = rabIskustvo; } public String getTelBr() { return telBr; } public void setTelBr(String telBr) { this.telBr = telBr; } public String getEMail() { return eMail; } public void setEMail(String eMail) { this.eMail = eMail; } public String getPrezime() { return prezime; } public void setPrezime(String prezime) { this.prezime = prezime; } public String getMiddleName() { return middleName; } public void setMiddleName(String middleName) { this.middleName = middleName; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public Users getUsers() { return users; } public void setUsers(Users users) { this.users = users; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } }