- Timestamp:
- 11/04/21 16:59:49 (3 years ago)
- Branches:
- master
- Children:
- 9504a09
- Parents:
- ce6ad22
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/app/src/main/java/parkup/entities/ParkingZone.java
rce6ad22 rf6bc52d 1 1 package parkup.entities; 2 3 import parkup.data.ParkingZoneLocation; 2 4 3 5 import javax.persistence.*; … … 10 12 @Id 11 13 @SequenceGenerator( 12 name="parking_zone_ generator",14 name="parking_zone_sequence_generator", 13 15 sequenceName = "parking_zone_sequence", 14 16 allocationSize = 1, 15 initialValue = 50017 initialValue = 600 16 18 ) 17 19 @GeneratedValue( //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e … … 31 33 private int capacity; 32 34 33 @Column(name = " work_hours")34 private String workHours;35 @Column(name = "vreme_od") //za rabotni casovi od: 36 private int from; 35 37 36 @Column(name = "location") 38 @Column(name = "vreme_do") //za rabotni casovi do: 39 private int to; 40 41 @Column(name = "lokacija") 37 42 private String location; 38 43 … … 40 45 private int zafateniMesta; 41 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 42 54 @OneToMany(cascade = {CascadeType.ALL}) 43 @JoinColumn(name = "parkingSpaces", nullable = false)44 55 private List<ParkingSpace> parkingSpaces; 45 56 46 public ParkingZone() { 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; 47 67 this.zafateniMesta = 0; 48 68 this.parkingSpaces = new ArrayList<ParkingSpace>(); 49 69 } 50 70 51 public ParkingZone(int pzId, String pzName, int price, int capacity, String workHours, String location, List<ParkingSpace> parkingSpaces) {71 public ParkingZone(int pzId, String pzName, int price, int capacity, String location, List<ParkingSpace> parkingSpaces, String color, int from, int to) { 52 72 this.pzId = pzId; 53 73 this.pzName = pzName; 54 74 this.price = price; 55 75 this.capacity = capacity; 56 this.workHours = workHours;57 76 this.location = location; 58 77 this.zafateniMesta = 0; 59 78 this.parkingSpaces = parkingSpaces; 79 this.color = color; 80 this.from = from; 81 this.to = to; 60 82 } 61 83 62 public ParkingZone(String pzName, int price, int capacity, String workHours, String location, List<ParkingSpace> parkingSpaces) {84 public ParkingZone(String pzName, int price, int capacity, String location, List<ParkingSpace> parkingSpaces, String color, int from, int to) { 63 85 this.pzName = pzName; 64 86 this.price = price; 65 87 this.capacity = capacity; 66 this.workHours = workHours;67 88 this.location = location; 68 89 this.zafateniMesta = 0; 69 90 this.parkingSpaces = parkingSpaces; 91 this.color = color; 92 this.from = from; 93 this.to = to; 70 94 } 71 95 … … 102 126 } 103 127 104 public String getWorkHours() {105 return this.workHours;106 }107 108 public void setWorkHours(String workHours) {109 this.workHours = workHours;110 }111 112 128 public String getLocation() { 113 129 return this.location; … … 125 141 126 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 } 127 183 }
Note:
See TracChangeset
for help on using the changeset viewer.