1 | package com.project.beautycenter.model;
|
---|
2 |
|
---|
3 | import org.hibernate.Hibernate;
|
---|
4 |
|
---|
5 | import javax.persistence.Column;
|
---|
6 | import javax.persistence.Embeddable;
|
---|
7 | import java.io.Serializable;
|
---|
8 | import java.util.Objects;
|
---|
9 |
|
---|
10 | @Embeddable
|
---|
11 | public class RezervacijaUslugiId implements Serializable {
|
---|
12 | private static final long serialVersionUID = -3337108313139433388L;
|
---|
13 | @Column(name = "br_rez", nullable = false)
|
---|
14 | private Integer brRez;
|
---|
15 | @Column(name = "usluga_id", nullable = false, length = 100)
|
---|
16 | private String uslugaId;
|
---|
17 |
|
---|
18 | public RezervacijaUslugiId(Integer brRez, String uslugaId) {
|
---|
19 | this.brRez = brRez;
|
---|
20 | this.uslugaId = uslugaId;
|
---|
21 | }
|
---|
22 | public RezervacijaUslugiId(){}
|
---|
23 |
|
---|
24 | public String getUslugaId() {
|
---|
25 | return uslugaId;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void setUslugaId(String uslugaId) {
|
---|
29 | this.uslugaId = uslugaId;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public Integer getBrRez() {
|
---|
33 | return brRez;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public void setBrRez(Integer brRez) {
|
---|
37 | this.brRez = brRez;
|
---|
38 | }
|
---|
39 |
|
---|
40 | @Override
|
---|
41 | public int hashCode() {
|
---|
42 | return Objects.hash(brRez, uslugaId);
|
---|
43 | }
|
---|
44 |
|
---|
45 | @Override
|
---|
46 | public boolean equals(Object o) {
|
---|
47 | if (this == o) return true;
|
---|
48 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
49 | RezervacijaUslugiId entity = (RezervacijaUslugiId) o;
|
---|
50 | return Objects.equals(this.brRez, entity.brRez) &&
|
---|
51 | Objects.equals(this.uslugaId, entity.uslugaId);
|
---|
52 | }
|
---|
53 | } |
---|