View Javadoc

1   /**
2    * 
3    */
4   package de.tivsource.page.entity.appointment;
5   
6   import java.util.Date;
7   
8   import javax.persistence.Basic;
9   import javax.persistence.Entity;
10  import javax.persistence.Temporal;
11  
12  import org.hibernate.envers.Audited;
13  
14  import de.tivsource.page.entity.contentitem.ContentItem;
15  
16  /**
17   * @author Marc Michele
18   *
19   */
20  @Audited
21  @Entity
22  public class Appointment extends ContentItem {
23  
24      @Temporal(javax.persistence.TemporalType.TIMESTAMP)
25  	private Date pointInTime;
26  
27      @Basic
28      @org.hibernate.annotations.Type(type = "yes_no")
29      private Boolean booking;
30      
31  	private String bookingUrl;
32  
33      @Basic
34      @org.hibernate.annotations.Type(type = "yes_no")
35      private Boolean hasVenue;
36  
37  	private String venue;
38  
39      @Temporal(javax.persistence.TemporalType.TIMESTAMP)
40      private Date visibleFrom;
41  	
42      public Date getPointInTime() {
43          return pointInTime;
44      }
45  
46      public void setPointInTime(Date pointInTime) {
47          this.pointInTime = pointInTime;
48      }
49  
50      public Boolean getBooking() {
51          return booking;
52      }
53  
54      public void setBooking(Boolean booking) {
55          this.booking = booking;
56      }
57  
58      public String getBookingUrl() {
59          return bookingUrl;
60      }
61  
62      public void setBookingUrl(String bookingUrl) {
63          this.bookingUrl = bookingUrl;
64      }
65  
66      public Boolean getHasVenue() {
67          return hasVenue;
68      }
69  
70      public void setHasVenue(Boolean hasVenue) {
71          this.hasVenue = hasVenue;
72      }
73  
74      public String getVenue() {
75          return venue;
76      }
77  
78      public void setVenue(String venue) {
79          this.venue = venue;
80      }
81  
82      public Date getVisibleFrom() {
83          return visibleFrom;
84      }
85  
86      public void setVisibleFrom(Date visibleFrom) {
87          this.visibleFrom = visibleFrom;
88      }
89  
90      /* (non-Javadoc)
91       * @see de.tivsource.page.entity.contentitem.ContentItem#getUrl()
92       */
93      @Override
94      public String getUrl() {
95          StringBuffer stringBuffer = new StringBuffer();
96          stringBuffer.append("/");
97          stringBuffer.append("appointment/");
98          stringBuffer.append(this.getUuid());
99          stringBuffer.append("/");
100         stringBuffer.append("index.html");
101         return stringBuffer.toString();
102     }
103 
104     @Override
105     public int compareTo(ContentItem o) {
106         if (o.getCreated().after(this.getCreated())) {
107             return 1;
108         } else if (o.getCreated().before(this.getCreated())) {
109             return -1;
110         } else {
111             return o.getUuid().compareTo(this.getUuid());
112         }
113     }
114 
115 }// Ende class