package com.project.beautycenter.model; import javax.persistence.*; @Entity @Table(name = "vraboteni_uslugi", schema = "project") public class VraboteniUslugi { @EmbeddedId private VraboteniUslugiId id; @MapsId("userIdVraboten") @ManyToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "user_id_vraboten", nullable = false) private Vraboteni userIdVraboten; @MapsId("uslugaId") @ManyToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "usluga_id", nullable = false) private Uslugi usluga; public VraboteniUslugi(){} public VraboteniUslugi(Vraboteni userIdVraboten, Uslugi usluga) { this.userIdVraboten = userIdVraboten; this.usluga = usluga; } public VraboteniUslugi(VraboteniUslugiId id, Vraboteni userIdVraboten, Uslugi usluga) { this.id = id; this.userIdVraboten = userIdVraboten; this.usluga = usluga; } public Uslugi getUsluga() { return usluga; } public void setUsluga(Uslugi usluga) { this.usluga = usluga; } public Vraboteni getUserIdVraboten() { return userIdVraboten; } public void setUserIdVraboten(Vraboteni userIdVraboten) { this.userIdVraboten = userIdVraboten; } public VraboteniUslugiId getId() { return id; } public void setId(VraboteniUslugiId id) { this.id = id; } }