main
Last change
on this file was d14176d, checked in by HristijanMitic00 <hristijan.mitic.01@…>, 19 months ago |
First commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package project.fmo.app.projcetfmo.Model;
|
---|
2 |
|
---|
3 | import javax.persistence.*;
|
---|
4 |
|
---|
5 | import java.io.Serializable;
|
---|
6 | import java.sql.Date;
|
---|
7 | import java.util.Objects;
|
---|
8 |
|
---|
9 | public class CenaPK implements Serializable {
|
---|
10 | @Column(name = "id_produkt")
|
---|
11 | @Id
|
---|
12 | private int idProdukt;
|
---|
13 | @Column(name = "cena_od")
|
---|
14 | @Id
|
---|
15 | private Date cenaOd;
|
---|
16 |
|
---|
17 | public CenaPK (){}
|
---|
18 | public CenaPK(Integer idProdukt, Date cenaOd) {
|
---|
19 | this.idProdukt = idProdukt;
|
---|
20 | this.cenaOd = cenaOd;
|
---|
21 | }
|
---|
22 |
|
---|
23 | public int getIdProdukt() {
|
---|
24 | return idProdukt;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public void setIdProdukt(int idProdukt) {
|
---|
28 | this.idProdukt = idProdukt;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public Date getCenaOd() {
|
---|
32 | return cenaOd;
|
---|
33 | }
|
---|
34 |
|
---|
35 | public void setCenaOd(Date cenaOd) {
|
---|
36 | this.cenaOd = cenaOd;
|
---|
37 | }
|
---|
38 |
|
---|
39 | @Override
|
---|
40 | public boolean equals(Object o) {
|
---|
41 | if (this == o) return true;
|
---|
42 | if (o == null || getClass() != o.getClass()) return false;
|
---|
43 | CenaPK cenaPK = (CenaPK) o;
|
---|
44 | return idProdukt == cenaPK.idProdukt && Objects.equals(cenaOd, cenaPK.cenaOd);
|
---|
45 | }
|
---|
46 |
|
---|
47 | @Override
|
---|
48 | public int hashCode() {
|
---|
49 | return Objects.hash(idProdukt, cenaOd);
|
---|
50 | }
|
---|
51 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.