View Javadoc

1   /**
2    * 
3    */
4   package de.tivsource.page.entity.location;
5   
6   import java.util.List;
7   import java.util.SortedSet;
8   
9   import javax.persistence.Basic;
10  import javax.persistence.CascadeType;
11  import javax.persistence.Column;
12  import javax.persistence.Embedded;
13  import javax.persistence.Entity;
14  import javax.persistence.FetchType;
15  import javax.persistence.OneToMany;
16  
17  import org.hibernate.annotations.SortNatural;
18  import org.hibernate.envers.Audited;
19  
20  import de.tivsource.page.entity.embeddable.Address;
21  import de.tivsource.page.entity.embeddable.ContactDetails;
22  import de.tivsource.page.entity.event.Event;
23  import de.tivsource.page.entity.pictureitem.PictureItem;
24  import de.tivsource.page.entity.vacancy.Vacancy;
25  
26  /**
27   * @author Marc Michele
28   *
29   */
30  @Audited
31  @Entity
32  public class Location extends PictureItem {
33  
34      @Embedded
35      private Address address;
36  
37      @Embedded
38      private ContactDetails contactDetails;
39  
40      @OneToMany(mappedBy = "location", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, orphanRemoval=true)
41      @SortNatural
42      private SortedSet<OpeningHour> openingHours;
43  
44      /**
45       * True wenn die Location auch in der Liste angezeigt werden soll.
46       */
47      @Basic
48      @org.hibernate.annotations.Type(type = "yes_no")
49      private Boolean inLocationList = true;
50  
51      /**
52       * Wenn in der Filiale Veranstaltungen stattfinden können, dann true wenn
53       * nicht dann false (Achtung die Location taucht nur im Eventformular auf
54       * wenn true).
55       */
56      @Basic
57      @org.hibernate.annotations.Type(type = "yes_no")
58      private Boolean event;
59  
60      @OneToMany(mappedBy = "location", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, orphanRemoval=true)
61      private List<Event> events;
62  
63      @OneToMany(mappedBy = "location", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, orphanRemoval=true)
64      private List<Vacancy> vacancies;
65  
66      /**
67       * Longitude der Location.
68       */
69      private String longitude;
70  
71      /**
72       * Latitude der Location.
73       */
74      private String latitude;
75  
76      @Column(name="orderNumber")
77      private Integer order = 1;
78  
79      public Address getAddress() {
80          return address;
81      }
82  
83      public void setAddress(Address address) {
84          this.address = address;
85      }
86  
87      public ContactDetails getContactDetails() {
88          return contactDetails;
89      }
90  
91      public void setContactDetails(ContactDetails contactDetails) {
92          this.contactDetails = contactDetails;
93      }
94  
95      public SortedSet<OpeningHour> getOpeningHours() {
96          return openingHours;
97      }
98  
99      public void setOpeningHours(SortedSet<OpeningHour> openingHours) {
100         this.openingHours = openingHours;
101     }
102 
103     public Boolean getInLocationList() {
104         return inLocationList;
105     }
106 
107     public void setInLocationList(Boolean inLocationList) {
108         this.inLocationList = inLocationList;
109     }
110 
111     public Boolean getEvent() {
112         return event;
113     }
114 
115     public void setEvent(Boolean event) {
116         this.event = event;
117     }
118 
119     public List<Event> getEvents() {
120         return events;
121     }
122 
123     public void setEvents(List<Event> events) {
124         this.events = events;
125     }
126 
127     public List<Vacancy> getVacancies() {
128         return vacancies;
129     }
130 
131     public void setVacancies(List<Vacancy> vacancies) {
132         this.vacancies = vacancies;
133     }
134 
135     public String getLongitude() {
136         return longitude;
137     }
138 
139     public void setLongitude(String longitude) {
140         this.longitude = longitude;
141     }
142 
143     public String getLatitude() {
144         return latitude;
145     }
146 
147     public void setLatitude(String latitude) {
148         this.latitude = latitude;
149     }
150 
151 	public Integer getOrder() {
152 		return order;
153 	}
154 
155 	public void setOrder(Integer order) {
156 		this.order = order;
157 	}
158 
159 }// Ende class