source: src/main/java/com/project/beautycenter/model/VraboteniUslugiId.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.5 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 VraboteniUslugiId implements Serializable {
12 private static final long serialVersionUID = -3435307854722955503L;
13 @Column(name = "user_id_vraboten", nullable = false)
14 private Integer userIdVraboten;
15 @Column(name = "usluga_id", nullable = false, length = 100)
16 private String uslugaId;
17
18 public String getUslugaId() {
19 return uslugaId;
20 }
21
22 public void setUslugaId(String uslugaId) {
23 this.uslugaId = uslugaId;
24 }
25
26 public Integer getUserIdVraboten() {
27 return userIdVraboten;
28 }
29
30 public void setUserIdVraboten(Integer userIdVraboten) {
31 this.userIdVraboten = userIdVraboten;
32 }
33
34 public VraboteniUslugiId(Integer userIdVraboten, String uslugaId) {
35 this.userIdVraboten = userIdVraboten;
36 this.uslugaId = uslugaId;
37 }
38 public VraboteniUslugiId(){}
39
40 @Override
41 public int hashCode() {
42 return Objects.hash(uslugaId, userIdVraboten);
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 VraboteniUslugiId entity = (VraboteniUslugiId) o;
50 return Objects.equals(this.uslugaId, entity.uslugaId) &&
51 Objects.equals(this.userIdVraboten, entity.userIdVraboten);
52 }
53}
Note: See TracBrowser for help on using the repository browser.