Ignore:
Timestamp:
11/04/21 16:59:49 (3 years ago)
Author:
DavidTrajkovski <davidtrajkovski11@…>
Branches:
master
Children:
9504a09
Parents:
ce6ad22
Message:

fixed delete methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/app/src/main/java/parkup/entities/ParkingZone.java

    rce6ad22 rf6bc52d  
    11package parkup.entities;
     2
     3import parkup.data.ParkingZoneLocation;
    24
    35import javax.persistence.*;
     
    1012    @Id
    1113    @SequenceGenerator(
    12             name="parking_zone_generator",
     14            name="parking_zone_sequence_generator",
    1315            sequenceName = "parking_zone_sequence",
    1416            allocationSize = 1,
    15             initialValue = 500
     17            initialValue = 600
    1618    )
    1719    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
     
    3133    private int capacity;
    3234
    33     @Column(name = "work_hours")
    34     private String workHours;
     35    @Column(name = "vreme_od")  //za rabotni casovi od:
     36    private int from;
    3537
    36     @Column(name = "location")
     38    @Column(name = "vreme_do")    //za rabotni casovi do:
     39    private int to;
     40
     41    @Column(name = "lokacija")
    3742    private String location;
    3843
     
    4045    private int zafateniMesta;
    4146
     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
    4254    @OneToMany(cascade = {CascadeType.ALL})
    43     @JoinColumn(name = "parkingSpaces", nullable = false)
    4455    private List<ParkingSpace> parkingSpaces;
    4556
    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;
    4767        this.zafateniMesta = 0;
    4868        this.parkingSpaces = new ArrayList<ParkingSpace>();
    4969    }
    5070
    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) {
    5272        this.pzId = pzId;
    5373        this.pzName = pzName;
    5474        this.price = price;
    5575        this.capacity = capacity;
    56         this.workHours = workHours;
    5776        this.location = location;
    5877        this.zafateniMesta = 0;
    5978        this.parkingSpaces = parkingSpaces;
     79        this.color = color;
     80        this.from = from;
     81        this.to = to;
    6082    }
    6183
    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) {
    6385        this.pzName = pzName;
    6486        this.price = price;
    6587        this.capacity = capacity;
    66         this.workHours = workHours;
    6788        this.location = location;
    6889        this.zafateniMesta = 0;
    6990        this.parkingSpaces = parkingSpaces;
     91        this.color = color;
     92        this.from = from;
     93        this.to = to;
    7094    }
    7195
     
    102126    }
    103127
    104     public String getWorkHours() {
    105         return this.workHours;
    106     }
    107 
    108     public void setWorkHours(String workHours) {
    109         this.workHours = workHours;
    110     }
    111 
    112128    public String getLocation() {
    113129        return this.location;
     
    125141
    126142    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    }
    127183}
Note: See TracChangeset for help on using the changeset viewer.