1 | package parkup.entities;
|
---|
2 |
|
---|
3 | import parkup.data.ParkingZoneLocation;
|
---|
4 |
|
---|
5 | import javax.persistence.*;
|
---|
6 | import java.util.ArrayList;
|
---|
7 | import java.util.List;
|
---|
8 |
|
---|
9 | @Entity
|
---|
10 | @Table(name = "parking_zone")
|
---|
11 | public 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 | <<<<<<< HEAD
|
---|
36 | @Column(name = "time_from") //za rabotni casovi od:
|
---|
37 | private int from;
|
---|
38 |
|
---|
39 | @Column(name = "time_to") //za rabotni casovi do:
|
---|
40 | =======
|
---|
41 | @Column(name = "vreme_od") //za rabotni casovi od:
|
---|
42 | private int from;
|
---|
43 |
|
---|
44 | @Column(name = "vreme_do") //za rabotni casovi do:
|
---|
45 | >>>>>>> 9504a097ce80831ea7e7130dff7215d5fbf8e939
|
---|
46 | private int to;
|
---|
47 |
|
---|
48 | @Column(name = "lokacija")
|
---|
49 | private String location;
|
---|
50 |
|
---|
51 | @Column(name = "zafateniMesta")
|
---|
52 | private int zafateniMesta;
|
---|
53 |
|
---|
54 | @Column(name = "color")
|
---|
55 | private String color;
|
---|
56 |
|
---|
57 | @ManyToMany(cascade = {CascadeType.ALL})
|
---|
58 | @JoinColumn(name="odgovorniLica",nullable = true)
|
---|
59 | private List<Vraboten> odgovorniLica;
|
---|
60 |
|
---|
61 | @OneToMany(cascade = {CascadeType.ALL})
|
---|
62 | private List<ParkingSpace> parkingSpaces;
|
---|
63 |
|
---|
64 | @OneToOne(cascade = {CascadeType.ALL})
|
---|
65 | private ParkingZoneLocation parkingZoneLocation;
|
---|
66 |
|
---|
67 | public ParkingZone() {
|
---|
68 | this.zafateniMesta = 0;
|
---|
69 | this.parkingSpaces = new ArrayList<ParkingSpace>();
|
---|
70 | }
|
---|
71 |
|
---|
72 | public ParkingZone(String pzName) {
|
---|
73 | this.pzName = pzName;
|
---|
74 | this.zafateniMesta = 0;
|
---|
75 | this.parkingSpaces = new ArrayList<ParkingSpace>();
|
---|
76 | }
|
---|
77 |
|
---|
78 | public ParkingZone(int pzId, String pzName, int price, int capacity, String location, List<ParkingSpace> parkingSpaces, String color, int from, int to) {
|
---|
79 | this.pzId = pzId;
|
---|
80 | this.pzName = pzName;
|
---|
81 | this.price = price;
|
---|
82 | this.capacity = capacity;
|
---|
83 | this.location = location;
|
---|
84 | this.zafateniMesta = 0;
|
---|
85 | this.parkingSpaces = parkingSpaces;
|
---|
86 | this.color = color;
|
---|
87 | this.from = from;
|
---|
88 | this.to = to;
|
---|
89 | }
|
---|
90 |
|
---|
91 | public ParkingZone(String pzName, int price, int capacity, String location, List<ParkingSpace> parkingSpaces, String color, int from, int to) {
|
---|
92 | this.pzName = pzName;
|
---|
93 | this.price = price;
|
---|
94 | this.capacity = capacity;
|
---|
95 | this.location = location;
|
---|
96 | this.zafateniMesta = 0;
|
---|
97 | this.parkingSpaces = parkingSpaces;
|
---|
98 | this.color = color;
|
---|
99 | this.from = from;
|
---|
100 | this.to = to;
|
---|
101 | }
|
---|
102 |
|
---|
103 | public int getId() {
|
---|
104 | return this.pzId;
|
---|
105 | }
|
---|
106 |
|
---|
107 | public void setId(int pzId) {
|
---|
108 | this.pzId = pzId;
|
---|
109 | }
|
---|
110 |
|
---|
111 | public String getPzName() {
|
---|
112 | return this.pzName;
|
---|
113 | }
|
---|
114 |
|
---|
115 | public void setPzName(String pzName) {
|
---|
116 | this.pzName = pzName;
|
---|
117 | }
|
---|
118 |
|
---|
119 | public int getPrice() {
|
---|
120 | return this.price;
|
---|
121 | }
|
---|
122 |
|
---|
123 | public void setPrice(int price) {
|
---|
124 | this.price = price;
|
---|
125 | }
|
---|
126 |
|
---|
127 | public int getCapacity() {
|
---|
128 | return this.capacity;
|
---|
129 | }
|
---|
130 |
|
---|
131 | public void setCapacity(int capacity) {
|
---|
132 | this.capacity = capacity;
|
---|
133 | }
|
---|
134 |
|
---|
135 | public String getLocation() {
|
---|
136 | return this.location;
|
---|
137 | }
|
---|
138 |
|
---|
139 | public void setLocation(String location) {
|
---|
140 | this.location = location;
|
---|
141 | }
|
---|
142 |
|
---|
143 | public int getZafateniMesta() {return zafateniMesta;}
|
---|
144 |
|
---|
145 | public void setZafateniMesta(int zafateniMesta) {this.zafateniMesta = zafateniMesta;}
|
---|
146 |
|
---|
147 | public List<ParkingSpace> getParkingSpaces() {return parkingSpaces;}
|
---|
148 |
|
---|
149 | public void setParkingSpaces(List<ParkingSpace> parkingSpaces) {this.parkingSpaces = parkingSpaces;}
|
---|
150 |
|
---|
151 | public String getColor() {
|
---|
152 | return color;
|
---|
153 | }
|
---|
154 |
|
---|
155 | public void setColor(String color) {
|
---|
156 | this.color = color;
|
---|
157 | }
|
---|
158 |
|
---|
159 | public int getFrom() {
|
---|
160 | return from;
|
---|
161 | }
|
---|
162 |
|
---|
163 | public void setFrom(int from) {
|
---|
164 | this.from = from;
|
---|
165 | }
|
---|
166 |
|
---|
167 | public int getTo() {
|
---|
168 | return to;
|
---|
169 | }
|
---|
170 |
|
---|
171 | public void setTo(int to) {
|
---|
172 | this.to = to;
|
---|
173 | }
|
---|
174 |
|
---|
175 | public ParkingZoneLocation getParkingZoneLocation() {
|
---|
176 | return parkingZoneLocation;
|
---|
177 | }
|
---|
178 |
|
---|
179 | public void setParkingZoneLocation(ParkingZoneLocation parkingZoneLocation) {
|
---|
180 | this.parkingZoneLocation = parkingZoneLocation;
|
---|
181 | }
|
---|
182 |
|
---|
183 | public List<Vraboten> getOdgovorniLica() {
|
---|
184 | return odgovorniLica;
|
---|
185 | }
|
---|
186 |
|
---|
187 | public void setOdgovorniLica(List<Vraboten> odgovorniLica) {
|
---|
188 | this.odgovorniLica = odgovorniLica;
|
---|
189 | }
|
---|
190 | }
|
---|