[850b344] | 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 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 | } |
---|