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

Last change on this file since d770228 was 80ddcae, checked in by Tasevski2 <39170279+Tasevski2@…>, 2 years ago

Fixed small bugs

  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[ce6ad22]1package parkup.entities;
2
[97fbc67]3import parkup.data.ParkingZoneLocation;
4
[ce6ad22]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(
[97fbc67]14 name="parking_zone_sequence_generator",
[ce6ad22]15 sequenceName = "parking_zone_sequence",
16 allocationSize = 1,
[97fbc67]17 initialValue = 600
[ce6ad22]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
[9ff45d6]32 @Transient
[ce6ad22]33 @Column(name = "capacity")
34 private int capacity;
[97fbc67]35 @Column(name = "time_from") //za rabotni casovi od:
36 private int from;
37
38 @Column(name = "time_to") //za rabotni casovi do:
39 private int to;
[ce6ad22]40
[9ff45d6]41 @Column(name = "address")
42 private String address;
[ce6ad22]43
[9ff45d6]44 @Transient
[9dd526f]45 @Column(name = "takenSpaces")
[9ff45d6]46 private int takenSpaces;
[ce6ad22]47
[97fbc67]48 @Column(name = "color")
49 private String color;
50
[9ff45d6]51// @ManyToMany(cascade = {CascadeType.ALL})
52// private List<Vraboten> odgovorniLica;
[97fbc67]53
[9dd526f]54 @OneToMany(cascade = {CascadeType.ALL})
[ce6ad22]55 private List<ParkingSpace> parkingSpaces;
56
[80ddcae]57 @Transient
58 private List<String> responsibleWorkers;
59
[9ff45d6]60
61
[97fbc67]62 @OneToOne(cascade = {CascadeType.ALL})
63 private ParkingZoneLocation parkingZoneLocation;
64
65 public ParkingZone() {
[9ff45d6]66 this.takenSpaces = 0;
[97fbc67]67 this.parkingSpaces = new ArrayList<ParkingSpace>();
68 }
69
70 public ParkingZone(String pzName) {
71 this.pzName = pzName;
[9ff45d6]72 this.takenSpaces = 0;
[ce6ad22]73 this.parkingSpaces = new ArrayList<ParkingSpace>();
74 }
75
[9ff45d6]76 public ParkingZone(int pzId, String pzName, int price, int capacity, String address, List<ParkingSpace> parkingSpaces, String color, int from, int to) {
[ce6ad22]77 this.pzId = pzId;
78 this.pzName = pzName;
79 this.price = price;
80 this.capacity = capacity;
[9ff45d6]81 this.address = address;
82 this.takenSpaces = 0;
[ce6ad22]83 this.parkingSpaces = parkingSpaces;
[97fbc67]84 this.color = color;
85 this.from = from;
86 this.to = to;
[ce6ad22]87 }
88
[9ff45d6]89 public ParkingZone(String pzName, int price, int capacity, String address, List<ParkingSpace> parkingSpaces, String color, int from, int to) {
[ce6ad22]90 this.pzName = pzName;
91 this.price = price;
92 this.capacity = capacity;
[9ff45d6]93 this.address = address;
94 this.takenSpaces = 0;
[ce6ad22]95 this.parkingSpaces = parkingSpaces;
[97fbc67]96 this.color = color;
97 this.from = from;
98 this.to = to;
[ce6ad22]99 }
100
101 public int getId() {
102 return this.pzId;
103 }
104
105 public void setId(int pzId) {
106 this.pzId = pzId;
107 }
108
109 public String getPzName() {
110 return this.pzName;
111 }
112
113 public void setPzName(String pzName) {
114 this.pzName = pzName;
115 }
116
117 public int getPrice() {
118 return this.price;
119 }
120
121 public void setPrice(int price) {
122 this.price = price;
123 }
[80ddcae]124 public List<String> getResponsibleWorkers() {
125 return responsibleWorkers;
126 }
[ce6ad22]127
[80ddcae]128 public void setResponsibleWorkers(List<String> responsibleWorkers) {
129 this.responsibleWorkers = responsibleWorkers;
130 }
[ce6ad22]131 public int getCapacity() {
132 return this.capacity;
133 }
134
135 public void setCapacity(int capacity) {
136 this.capacity = capacity;
137 }
138
[9ff45d6]139 public String getAddress() {
140 return this.address;
[ce6ad22]141 }
142
[9ff45d6]143 public void setAddress(String location) {
144 this.address = location;
[ce6ad22]145 }
146
[9ff45d6]147 public int getTakenSpaces() {return takenSpaces;}
[ce6ad22]148
[9ff45d6]149 public void setTakenSpaces(int takenSpaces) {this.takenSpaces = takenSpaces;}
[ce6ad22]150
151 public List<ParkingSpace> getParkingSpaces() {return parkingSpaces;}
152
153 public void setParkingSpaces(List<ParkingSpace> parkingSpaces) {this.parkingSpaces = parkingSpaces;}
[97fbc67]154
155 public String getColor() {
156 return color;
157 }
158
159 public void setColor(String color) {
160 this.color = color;
161 }
162
163 public int getFrom() {
164 return from;
165 }
166
167 public void setFrom(int from) {
168 this.from = from;
169 }
170
171 public int getTo() {
172 return to;
173 }
174
175 public void setTo(int to) {
176 this.to = to;
177 }
178
179 public ParkingZoneLocation getParkingZoneLocation() {
180 return parkingZoneLocation;
181 }
182
183 public void setParkingZoneLocation(ParkingZoneLocation parkingZoneLocation) {
184 this.parkingZoneLocation = parkingZoneLocation;
185 }
186
[9ff45d6]187 // public List<Vraboten> getOdgovorniLica() {
188// return odgovorniLica;
189// }
190//
191// public void setOdgovorniLica(List<Vraboten> odgovorniLica) {
192// this.odgovorniLica = odgovorniLica;
193// }
[ce6ad22]194}
Note: See TracBrowser for help on using the repository browser.