Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.helan.videoafisha.entitiy;
- import lombok.EqualsAndHashCode;
- import lombok.Getter;
- import lombok.NoArgsConstructor;
- import lombok.Setter;
- import org.hibernate.annotations.Type;
- import javax.persistence.*;
- import java.io.Serializable;
- import java.util.ArrayList;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Set;
- @NoArgsConstructor
- @Getter @Setter
- @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
- @Entity
- public class Location extends Identifiable implements Serializable {
- @Column(nullable = false)
- private String title;
- @Column
- private Integer maxDeviceCount;
- @Type(type = "jsonb")
- @Column(columnDefinition = "jsonb")
- private Geolocation geolocation;
- @ManyToOne(optional = false)
- @JoinColumn(nullable = false)
- private Site site;
- @OneToMany(mappedBy = "location")
- private List<Device> devices = new ArrayList<>();
- @ManyToMany(mappedBy = "locations")
- private Set<Booking> bookings = new HashSet<>();
- @OneToMany(mappedBy = "location", cascade = CascadeType.ALL, orphanRemoval = true)
- private List<LocationScheduleTimeRange> scheduleTimeRanges = new ArrayList<>();
- @ManyToOne(optional = false)
- @JoinColumn(nullable = false)
- private TimeZone timeZone;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement