Advertisement
popov-aa

Location.java

Apr 1st, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. package com.helan.videoafisha.entitiy;
  2.  
  3. import lombok.EqualsAndHashCode;
  4. import lombok.Getter;
  5. import lombok.NoArgsConstructor;
  6. import lombok.Setter;
  7. import org.hibernate.annotations.Type;
  8.  
  9. import javax.persistence.*;
  10. import java.io.Serializable;
  11. import java.util.ArrayList;
  12. import java.util.HashSet;
  13. import java.util.List;
  14. import java.util.Set;
  15.  
  16. @NoArgsConstructor
  17. @Getter @Setter
  18. @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
  19. @Entity
  20. public class Location extends Identifiable implements Serializable {
  21.  
  22.     @Column(nullable = false)
  23.     private String title;
  24.  
  25.     @Column
  26.     private Integer maxDeviceCount;
  27.  
  28.     @Type(type = "jsonb")
  29.     @Column(columnDefinition = "jsonb")
  30.     private Geolocation geolocation;
  31.  
  32.     @ManyToOne(optional = false)
  33.     @JoinColumn(nullable = false)
  34.     private Site site;
  35.  
  36.     @OneToMany(mappedBy = "location")
  37.     private List<Device> devices = new ArrayList<>();
  38.  
  39.     @ManyToMany(mappedBy = "locations")
  40.     private Set<Booking> bookings = new HashSet<>();
  41.  
  42.     @OneToMany(mappedBy = "location", cascade = CascadeType.ALL, orphanRemoval = true)
  43.     private List<LocationScheduleTimeRange> scheduleTimeRanges = new ArrayList<>();
  44.  
  45.     @ManyToOne(optional = false)
  46.     @JoinColumn(nullable = false)
  47.     private TimeZone timeZone;
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement