1 | package mk.ukim.finki.busngo.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 |
|
---|
5 | import java.util.Collection;
|
---|
6 | import java.util.Objects;
|
---|
7 |
|
---|
8 | @Entity
|
---|
9 | public class Tipbilet {
|
---|
10 | private Integer tbId;
|
---|
11 | private Long tbTrajnost;
|
---|
12 | private String tbIme;
|
---|
13 | private Collection<Bilet> biletsByTbId;
|
---|
14 |
|
---|
15 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
16 | @Id
|
---|
17 | @Column(name = "tb_id", nullable = false)
|
---|
18 | public Integer getTbId() {
|
---|
19 | return tbId;
|
---|
20 | }
|
---|
21 |
|
---|
22 | public void setTbId(Integer tbId) {
|
---|
23 | this.tbId = tbId;
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Basic
|
---|
27 | @Column(name = "tb_trajnost", nullable = false)
|
---|
28 | public Long getTbTrajnost() {
|
---|
29 | return tbTrajnost;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public void setTbTrajnost(Long tbTrajnost) {
|
---|
33 | this.tbTrajnost = tbTrajnost;
|
---|
34 | }
|
---|
35 |
|
---|
36 | @Basic
|
---|
37 | @Column(name = "tb_ime", nullable = false)
|
---|
38 | public String getTbIme() {
|
---|
39 | return tbIme;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void setTbIme(String tbIme) {
|
---|
43 | this.tbIme = tbIme;
|
---|
44 | }
|
---|
45 |
|
---|
46 | @Override
|
---|
47 | public boolean equals(Object o) {
|
---|
48 | if (this == o) return true;
|
---|
49 | if (o == null || getClass() != o.getClass()) return false;
|
---|
50 | Tipbilet tipbilet = (Tipbilet) o;
|
---|
51 | return Objects.equals(tbId, tipbilet.tbId) && Objects.equals(tbTrajnost, tipbilet.tbTrajnost) && Objects.equals(tbIme, tipbilet.tbIme);
|
---|
52 | }
|
---|
53 |
|
---|
54 | @Override
|
---|
55 | public int hashCode() {
|
---|
56 | return Objects.hash(tbId, tbTrajnost, tbIme);
|
---|
57 | }
|
---|
58 |
|
---|
59 | @OneToMany(mappedBy = "tipbiletByTbId")
|
---|
60 | public Collection<Bilet> getBiletsByTbId() {
|
---|
61 | return biletsByTbId;
|
---|
62 | }
|
---|
63 |
|
---|
64 | public void setBiletsByTbId(Collection<Bilet> biletsByTbId) {
|
---|
65 | this.biletsByTbId = biletsByTbId;
|
---|
66 | }
|
---|
67 | }
|
---|