source: sources/app/src/main/java/parkup/entities/ParkingZone.java@ 9504a09

Last change on this file since 9504a09 was f6bc52d, checked in by DavidTrajkovski <davidtrajkovski11@…>, 3 years ago

fixed delete methods

  • Property mode set to 100644
File size: 4.5 KB
Line 
1package parkup.entities;
2
3import parkup.data.ParkingZoneLocation;
4
5import javax.persistence.*;
6import java.util.ArrayList;
7import java.util.List;
8
9@Entity
10@Table(name = "parking_zone")
11public class ParkingZone {
12 @Id
13 @SequenceGenerator(
14 name="parking_zone_sequence_generator",
15 sequenceName = "parking_zone_sequence",
16 allocationSize = 1,
17 initialValue = 600
18 )
19 @GeneratedValue( //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
20 strategy = GenerationType.SEQUENCE,
21 generator = "parking_zone_sequence_generator"
22 )
23 @Column(name = "parking_zone_id")
24 private int pzId;
25
26 @Column(name = "pz_name")
27 private String pzName;
28
29 @Column(name = "price")
30 private int price;
31
32 @Column(name = "capacity")
33 private int capacity;
34
35 @Column(name = "vreme_od") //za rabotni casovi od:
36 private int from;
37
38 @Column(name = "vreme_do") //za rabotni casovi do:
39 private int to;
40
41 @Column(name = "lokacija")
42 private String location;
43
44 @Column(name = "zafateniMesta")
45 private int zafateniMesta;
46
47 @Column(name = "color")
48 private String color;
49
50 @ManyToMany(cascade = {CascadeType.ALL})
51 @JoinColumn(name="odgovorniLica",nullable = true)
52 private List<Vraboten> odgovorniLica;
53
54 @OneToMany(cascade = {CascadeType.ALL})
55 private List<ParkingSpace> parkingSpaces;
56
57 @OneToOne(cascade = {CascadeType.ALL})
58 private ParkingZoneLocation parkingZoneLocation;
59
60 public ParkingZone() {
61 this.zafateniMesta = 0;
62 this.parkingSpaces = new ArrayList<ParkingSpace>();
63 }
64
65 public ParkingZone(String pzName) {
66 this.pzName = pzName;
67 this.zafateniMesta = 0;
68 this.parkingSpaces = new ArrayList<ParkingSpace>();
69 }
70
71 public ParkingZone(int pzId, String pzName, int price, int capacity, String location, List<ParkingSpace> parkingSpaces, String color, int from, int to) {
72 this.pzId = pzId;
73 this.pzName = pzName;
74 this.price = price;
75 this.capacity = capacity;
76 this.location = location;
77 this.zafateniMesta = 0;
78 this.parkingSpaces = parkingSpaces;
79 this.color = color;
80 this.from = from;
81 this.to = to;
82 }
83
84 public ParkingZone(String pzName, int price, int capacity, String location, List<ParkingSpace> parkingSpaces, String color, int from, int to) {
85 this.pzName = pzName;
86 this.price = price;
87 this.capacity = capacity;
88 this.location = location;
89 this.zafateniMesta = 0;
90 this.parkingSpaces = parkingSpaces;
91 this.color = color;
92 this.from = from;
93 this.to = to;
94 }
95
96 public int getId() {
97 return this.pzId;
98 }
99
100 public void setId(int pzId) {
101 this.pzId = pzId;
102 }
103
104 public String getPzName() {
105 return this.pzName;
106 }
107
108 public void setPzName(String pzName) {
109 this.pzName = pzName;
110 }
111
112 public int getPrice() {
113 return this.price;
114 }
115
116 public void setPrice(int price) {
117 this.price = price;
118 }
119
120 public int getCapacity() {
121 return this.capacity;
122 }
123
124 public void setCapacity(int capacity) {
125 this.capacity = capacity;
126 }
127
128 public String getLocation() {
129 return this.location;
130 }
131
132 public void setLocation(String location) {
133 this.location = location;
134 }
135
136 public int getZafateniMesta() {return zafateniMesta;}
137
138 public void setZafateniMesta(int zafateniMesta) {this.zafateniMesta = zafateniMesta;}
139
140 public List<ParkingSpace> getParkingSpaces() {return parkingSpaces;}
141
142 public void setParkingSpaces(List<ParkingSpace> parkingSpaces) {this.parkingSpaces = parkingSpaces;}
143
144 public String getColor() {
145 return color;
146 }
147
148 public void setColor(String color) {
149 this.color = color;
150 }
151
152 public int getFrom() {
153 return from;
154 }
155
156 public void setFrom(int from) {
157 this.from = from;
158 }
159
160 public int getTo() {
161 return to;
162 }
163
164 public void setTo(int to) {
165 this.to = to;
166 }
167
168 public ParkingZoneLocation getParkingZoneLocation() {
169 return parkingZoneLocation;
170 }
171
172 public void setParkingZoneLocation(ParkingZoneLocation parkingZoneLocation) {
173 this.parkingZoneLocation = parkingZoneLocation;
174 }
175
176 public List<Vraboten> getOdgovorniLica() {
177 return odgovorniLica;
178 }
179
180 public void setOdgovorniLica(List<Vraboten> odgovorniLica) {
181 this.odgovorniLica = odgovorniLica;
182 }
183}
Note: See TracBrowser for help on using the repository browser.