1 | package mk.ukim.finki.busngo.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 |
|
---|
5 | import java.util.Collection;
|
---|
6 | import java.util.List;
|
---|
7 | import java.util.Objects;
|
---|
8 |
|
---|
9 | @Entity
|
---|
10 | public class Mesto {
|
---|
11 | private Integer mId;
|
---|
12 | private String mGrad;
|
---|
13 | private String mOpstina;
|
---|
14 | private String mUlica;
|
---|
15 | private List<Postojka> postojkasByMId;
|
---|
16 |
|
---|
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
18 | @Id
|
---|
19 | @Column(name = "m_id", nullable = false)
|
---|
20 | public Integer getmId() {
|
---|
21 | return mId;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public void setmId(Integer mId) {
|
---|
25 | this.mId = mId;
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Basic
|
---|
29 | @Column(name = "m_grad", nullable = false)
|
---|
30 | public String getmGrad() {
|
---|
31 | return mGrad;
|
---|
32 | }
|
---|
33 |
|
---|
34 | public void setmGrad(String mGrad) {
|
---|
35 | this.mGrad = mGrad;
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Basic
|
---|
39 | @Column(name = "m_opstina", nullable = false)
|
---|
40 | public String getmOpstina() {
|
---|
41 | return mOpstina;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public void setmOpstina(String mOpstina) {
|
---|
45 | this.mOpstina = mOpstina;
|
---|
46 | }
|
---|
47 |
|
---|
48 | @Basic
|
---|
49 | @Column(name = "m_ulica", nullable = false)
|
---|
50 | public String getmUlica() {
|
---|
51 | return mUlica;
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void setmUlica(String mUlica) {
|
---|
55 | this.mUlica = mUlica;
|
---|
56 | }
|
---|
57 |
|
---|
58 | @Override
|
---|
59 | public boolean equals(Object o) {
|
---|
60 | if (this == o) return true;
|
---|
61 | if (o == null || getClass() != o.getClass()) return false;
|
---|
62 | Mesto mesto = (Mesto) o;
|
---|
63 | return Objects.equals(mId, mesto.mId) && Objects.equals(mGrad, mesto.mGrad) && Objects.equals(mOpstina, mesto.mOpstina) && Objects.equals(mUlica, mesto.mUlica);
|
---|
64 | }
|
---|
65 |
|
---|
66 | @Override
|
---|
67 | public int hashCode() {
|
---|
68 | return Objects.hash(mId, mGrad, mOpstina, mUlica);
|
---|
69 | }
|
---|
70 |
|
---|
71 | @OneToMany(mappedBy = "mestoByMId")
|
---|
72 | public List<Postojka> getPostojkasByMId() {
|
---|
73 | return postojkasByMId;
|
---|
74 | }
|
---|
75 |
|
---|
76 | public void setPostojkasByMId(List<Postojka> postojkasByMId) {
|
---|
77 | this.postojkasByMId = postojkasByMId;
|
---|
78 | }
|
---|
79 | }
|
---|