Last change
on this file since c45b67b was 9dd526f, checked in by andrejTavchioski <andrej.tavchioski@…>, 3 years ago |
backend refactoring
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[97fbc67] | 1 | package parkup.data;
|
---|
| 2 |
|
---|
| 3 | import javax.persistence.*;
|
---|
| 4 | import java.util.List;
|
---|
| 5 |
|
---|
| 6 | @Entity
|
---|
| 7 | public 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 |
|
---|
[9ff45d6] | 22 | @OneToOne(cascade = {CascadeType.ALL})
|
---|
[97fbc67] | 23 | private Location centre;
|
---|
| 24 |
|
---|
[9ff45d6] | 25 | @OneToMany(cascade = {CascadeType.ALL})
|
---|
[9dd526f] | 26 | private List<Location> coords;
|
---|
[97fbc67] | 27 |
|
---|
[9dd526f] | 28 | public ParkingZoneLocation(int parkingZoneLocationId, Location centre, List<Location> coords) {
|
---|
[97fbc67] | 29 | this.parkingZoneLocationId = parkingZoneLocationId;
|
---|
| 30 | this.centre = centre;
|
---|
[9dd526f] | 31 | this.coords = coords;
|
---|
[97fbc67] | 32 | }
|
---|
| 33 |
|
---|
[9dd526f] | 34 | public ParkingZoneLocation(Location centre, List<Location> coords) {
|
---|
[97fbc67] | 35 | this.centre = centre;
|
---|
[9dd526f] | 36 | this.coords = coords;
|
---|
[97fbc67] | 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 |
|
---|
[9dd526f] | 49 | public List<Location> getCoords() {
|
---|
| 50 | return coords;
|
---|
[97fbc67] | 51 | }
|
---|
| 52 |
|
---|
[9dd526f] | 53 | public void setCoords(List<Location> teminja) {
|
---|
| 54 | this.coords = teminja;
|
---|
[97fbc67] | 55 | }
|
---|
| 56 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.