1 | package project.fmo.app.projcetfmo.Model;
|
---|
2 |
|
---|
3 | import javax.persistence.*;
|
---|
4 |
|
---|
5 | import java.sql.Date;
|
---|
6 | import java.util.Objects;
|
---|
7 |
|
---|
8 | @Entity
|
---|
9 | @Table(schema = "project", name = "naracka", catalog = "db_202223z_va_prj_fmo")
|
---|
10 | public class Naracka {
|
---|
11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
12 | @Id
|
---|
13 | @Column(name = "id_naracka")
|
---|
14 | private int idNaracka;
|
---|
15 | @Basic
|
---|
16 | @Column(name = "vkupno_suma")
|
---|
17 | private int vkupnoSuma;
|
---|
18 | @Basic
|
---|
19 | @Column(name = "datum")
|
---|
20 | private Date datum;
|
---|
21 | @Basic
|
---|
22 | @Column(name = "status")
|
---|
23 | private String status;
|
---|
24 | @Basic
|
---|
25 | @Column(name = "adresa")
|
---|
26 | private String adresa;
|
---|
27 | @ManyToOne
|
---|
28 | @JoinColumn(name = "id_korisnik")
|
---|
29 | private Kupuvac kupuvac;
|
---|
30 |
|
---|
31 | public Naracka(){}
|
---|
32 |
|
---|
33 | public Naracka(int vkupnoSuma, Date datum, String status, String adresa, Kupuvac kupuvac) {
|
---|
34 | this.vkupnoSuma = vkupnoSuma;
|
---|
35 | this.datum = datum;
|
---|
36 | this.status = status;
|
---|
37 | this.adresa = adresa;
|
---|
38 | this.kupuvac = kupuvac;
|
---|
39 | }
|
---|
40 |
|
---|
41 | public int getIdNaracka() {
|
---|
42 | return idNaracka;
|
---|
43 | }
|
---|
44 |
|
---|
45 | public void setIdNaracka(int idNaracka) {
|
---|
46 | this.idNaracka = idNaracka;
|
---|
47 | }
|
---|
48 |
|
---|
49 | public int getVkupnoSuma() {
|
---|
50 | return vkupnoSuma;
|
---|
51 | }
|
---|
52 |
|
---|
53 | public void setVkupnoSuma(int vkupnoSuma) {
|
---|
54 | this.vkupnoSuma = vkupnoSuma;
|
---|
55 | }
|
---|
56 |
|
---|
57 | public Date getDatum() {
|
---|
58 | return datum;
|
---|
59 | }
|
---|
60 |
|
---|
61 | public void setDatum(Date datum) {
|
---|
62 | this.datum = datum;
|
---|
63 | }
|
---|
64 |
|
---|
65 | public String getStatus() {
|
---|
66 | return status;
|
---|
67 | }
|
---|
68 |
|
---|
69 | public void setStatus(String status) {
|
---|
70 | this.status = status;
|
---|
71 | }
|
---|
72 |
|
---|
73 | public String getAdresa() {
|
---|
74 | return adresa;
|
---|
75 | }
|
---|
76 |
|
---|
77 | public void setAdresa(String adresa) {
|
---|
78 | this.adresa = adresa;
|
---|
79 | }
|
---|
80 |
|
---|
81 | public int getIdKorisnik() {
|
---|
82 | return kupuvac.getIdKorisnik();
|
---|
83 | }
|
---|
84 |
|
---|
85 | public void setIdKorisnik(int idKorisnik) {
|
---|
86 | this.kupuvac.setIdKorisnik(idKorisnik);
|
---|
87 | }
|
---|
88 |
|
---|
89 | @Override
|
---|
90 | public boolean equals(Object o) {
|
---|
91 | if (this == o) return true;
|
---|
92 | if (o == null || getClass() != o.getClass()) return false;
|
---|
93 | Naracka naracka = (Naracka) o;
|
---|
94 | return idNaracka == naracka.idNaracka && vkupnoSuma == naracka.vkupnoSuma && kupuvac == naracka.kupuvac && Objects.equals(datum, naracka.datum) && Objects.equals(status, naracka.status) && Objects.equals(adresa, naracka.adresa);
|
---|
95 | }
|
---|
96 |
|
---|
97 | @Override
|
---|
98 | public int hashCode() {
|
---|
99 | return Objects.hash(idNaracka, vkupnoSuma, datum, status, adresa, kupuvac);
|
---|
100 | }
|
---|
101 | }
|
---|