source: src/main/java/com/example/baza/model/EOdId.java

Last change on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package com.example.baza.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 EOdId implements Serializable {
12 private static final long serialVersionUID = -2023892387074364524L;
13 @Column(name = "id_knigi", nullable = false)
14 private Integer idKnigi;
15 @Column(name = "id_na_kategorija", nullable = false)
16 private Integer idNaKategorija;
17
18 public Integer getIdNaKategorija() {
19 return idNaKategorija;
20 }
21
22 public void setIdNaKategorija(Integer idNaKategorija) {
23 this.idNaKategorija = idNaKategorija;
24 }
25
26 public Integer getIdKnigi() {
27 return idKnigi;
28 }
29
30 public void setIdKnigi(Integer idKnigi) {
31 this.idKnigi = idKnigi;
32 }
33
34 @Override
35 public int hashCode() {
36 return Objects.hash(idNaKategorija, idKnigi);
37 }
38
39 @Override
40 public boolean equals(Object o) {
41 if (this == o) return true;
42 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
43 EOdId entity = (EOdId) o;
44 return Objects.equals(this.idNaKategorija, entity.idNaKategorija) &&
45 Objects.equals(this.idKnigi, entity.idKnigi);
46 }
47}
Note: See TracBrowser for help on using the repository browser.