source: src/main/java/project/fmo/app/projcetfmo/Model/CenaPK.java@ d14176d

main
Last change on this file since d14176d was d14176d, checked in by HristijanMitic00 <hristijan.mitic.01@…>, 12 months ago

First commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1package project.fmo.app.projcetfmo.Model;
2
3import javax.persistence.*;
4
5import java.io.Serializable;
6import java.sql.Date;
7import java.util.Objects;
8
9public 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.