1 package net
.bzzt
.ical
.aggregator
.model
;
3 import java
.io
.Serializable
;
7 import javax
.persistence
.Column
;
8 import javax
.persistence
.Entity
;
9 import javax
.persistence
.GeneratedValue
;
10 import javax
.persistence
.Id
;
12 import net
.bzzt
.ical
.aggregator
.web
.model
.Identifiable
;
14 import org
.hibernate
.annotations
.Cache
;
15 import org
.hibernate
.annotations
.CacheConcurrencyStrategy
;
18 @Cache(usage
=CacheConcurrencyStrategy
.READ_WRITE
)
19 public class Feed
implements Serializable
, Identifiable
<Long
>, Comparable
<Feed
> {
23 private static final long serialVersionUID
= 1L;
29 @Column(nullable
=false)
32 @Column(nullable
=false,unique
=true)
33 public String shortName
;
36 * Feeds zonder URL hebben alleen handmatige events
38 @Column(nullable
=true)
41 public Date lastUpdate
;
43 public Integer lastUpdateEvents
= 0;
45 public Integer lastUpdateAdded
= 0;
47 public String lastUpdateError
;
49 private Integer prio
= 50;
51 private Boolean showByDefault
= true;
53 /** bijv. homepage van de bron */
56 public String description
;
60 public Feed(String name
, String shortName
) {
61 this.shortName
= shortName
;
65 public Feed(String name
, String shortName
, URL url
, URL link
, String description
, Integer prio
, Boolean showByDefault
)
68 this.shortName
= shortName
;
71 this.description
= description
;
73 this.showByDefault
= showByDefault
;
85 public String
toString() {
89 public Integer
getPrio() {
93 public void setPrio(Integer prio
)
106 * @see java.lang.Object#equals(java.lang.Object)
109 public boolean equals(Object obj
)
111 if (obj
== null || !(obj
instanceof Feed
))
115 Feed feed
= (Feed
) obj
;
118 return id
.equals(feed
.getId());
127 * @return the showByDefault
129 public Boolean
getShowByDefault()
131 return showByDefault
;
135 * @param showByDefault the showByDefault to set
137 public void setShowByDefault(Boolean showByDefault
)
139 if (showByDefault
== null)
141 this.showByDefault
= true;
145 this.showByDefault
= showByDefault
;
150 public int compareTo(Feed o
)
152 return name
.compareTo(o
.name
);
158 public String
getName()
164 * @param name the name to set
166 public void setName(String name
)
172 * @return the shortName
174 public String
getShortName()
180 * @param shortName the shortName to set
182 public void setShortName(String shortName
)
184 this.shortName
= shortName
;