main
Last change
on this file since 1dd9226 was 1dd9226, checked in by HristijanMitic00 <hristijan.mitic.01@…>, 17 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | package model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.Column;
|
---|
4 | import jakarta.persistence.GeneratedValue;
|
---|
5 | import jakarta.persistence.GenerationType;
|
---|
6 | import jakarta.persistence.Id;
|
---|
7 |
|
---|
8 | import java.io.Serializable;
|
---|
9 | import java.util.Objects;
|
---|
10 |
|
---|
11 | public class ProduktEOdKategorijaPK implements Serializable {
|
---|
12 | @Column(name = "id_produkt")
|
---|
13 | @Id
|
---|
14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
15 | private int idProdukt;
|
---|
16 | @Column(name = "id_kategorija")
|
---|
17 | @Id
|
---|
18 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
19 | private int idKategorija;
|
---|
20 |
|
---|
21 | public int getIdProdukt() {
|
---|
22 | return idProdukt;
|
---|
23 | }
|
---|
24 |
|
---|
25 | public void setIdProdukt(int idProdukt) {
|
---|
26 | this.idProdukt = idProdukt;
|
---|
27 | }
|
---|
28 |
|
---|
29 | public int getIdKategorija() {
|
---|
30 | return idKategorija;
|
---|
31 | }
|
---|
32 |
|
---|
33 | public void setIdKategorija(int idKategorija) {
|
---|
34 | this.idKategorija = idKategorija;
|
---|
35 | }
|
---|
36 |
|
---|
37 | @Override
|
---|
38 | public boolean equals(Object o) {
|
---|
39 | if (this == o) return true;
|
---|
40 | if (o == null || getClass() != o.getClass()) return false;
|
---|
41 | ProduktEOdKategorijaPK that = (ProduktEOdKategorijaPK) o;
|
---|
42 | return idProdukt == that.idProdukt && idKategorija == that.idKategorija;
|
---|
43 | }
|
---|
44 |
|
---|
45 | @Override
|
---|
46 | public int hashCode() {
|
---|
47 | return Objects.hash(idProdukt, idKategorija);
|
---|
48 | }
|
---|
49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.