source: sources/app/src/main/java/parkup/data/ParkingZoneLocation.java@ 9ff45d6

Last change on this file since 9ff45d6 was 9ff45d6, checked in by andrejTavchioski <andrej.tavchioski@…>, 3 years ago

Fixed some functionalities related to parkingSessions and parkingZones

  • Property mode set to 100644
File size: 1.5 KB
Line 
1package parkup.data;
2
3import javax.persistence.*;
4import java.util.List;
5
6@Entity
7public class ParkingZoneLocation {
8 @Id
9 @Column(name = "parkingZoneLocation_id")
10 @SequenceGenerator(
11 name="parkingZoneLocation_sequence_generator",
12 sequenceName = "parkingZoneLocation_sequence",
13 allocationSize = 1,
14 initialValue = 1400
15 )
16 @GeneratedValue( //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
17 strategy = GenerationType.SEQUENCE,
18 generator = "parkingZoneLocation_sequence_generator"
19 )
20 private int parkingZoneLocationId;
21
22 @OneToOne(cascade = {CascadeType.ALL})
23 private Location centre;
24
25 @OneToMany(cascade = {CascadeType.ALL})
26 private List<Location> teminja;
27
28 public ParkingZoneLocation(int parkingZoneLocationId, Location centre, List<Location> teminja) {
29 this.parkingZoneLocationId = parkingZoneLocationId;
30 this.centre = centre;
31 this.teminja = teminja;
32 }
33
34 public ParkingZoneLocation(Location centre, List<Location> teminja) {
35 this.centre = centre;
36 this.teminja = teminja;
37 }
38
39 public ParkingZoneLocation() {}
40
41 public Location getCentre() {
42 return centre;
43 }
44
45 public void setCentre(Location centre) {
46 this.centre = centre;
47 }
48
49 public List<Location> getTeminja() {
50 return teminja;
51 }
52
53 public void setTeminja(List<Location> teminja) {
54 this.teminja = teminja;
55 }
56}
Note: See TracBrowser for help on using the repository browser.