source: src/main/java/com/project/beautycenter/model/RezervacijaUslugiId.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: 1.4 KB
RevLine 
[850b344]1package com.project.beautycenter.model;
2
3import org.hibernate.Hibernate;
4
5import javax.persistence.Column;
6import javax.persistence.Embeddable;
7import java.io.Serializable;
8import java.util.Objects;
9
10@Embeddable
11public 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}
Note: See TracBrowser for help on using the repository browser.