package com.project.beautycenter.model; import org.hibernate.Hibernate; import javax.persistence.Column; import javax.persistence.Embeddable; import java.io.Serializable; import java.util.Objects; @Embeddable public class RezervacijaUslugiId implements Serializable { private static final long serialVersionUID = -3337108313139433388L; @Column(name = "br_rez", nullable = false) private Integer brRez; @Column(name = "usluga_id", nullable = false, length = 100) private String uslugaId; public RezervacijaUslugiId(Integer brRez, String uslugaId) { this.brRez = brRez; this.uslugaId = uslugaId; } public RezervacijaUslugiId(){} public String getUslugaId() { return uslugaId; } public void setUslugaId(String uslugaId) { this.uslugaId = uslugaId; } public Integer getBrRez() { return brRez; } public void setBrRez(Integer brRez) { this.brRez = brRez; } @Override public int hashCode() { return Objects.hash(brRez, uslugaId); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; RezervacijaUslugiId entity = (RezervacijaUslugiId) o; return Objects.equals(this.brRez, entity.brRez) && Objects.equals(this.uslugaId, entity.uslugaId); } }