2013-03-23 16:17:19 +01:00
|
|
|
package com.commafeed.backend.model;
|
2013-03-20 20:33:42 +01:00
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import javax.persistence.Column;
|
|
|
|
|
import javax.persistence.Entity;
|
|
|
|
|
import javax.persistence.OneToMany;
|
|
|
|
|
import javax.persistence.Table;
|
|
|
|
|
import javax.persistence.Temporal;
|
|
|
|
|
import javax.persistence.TemporalType;
|
|
|
|
|
|
2013-03-29 11:51:27 +01:00
|
|
|
import org.hibernate.annotations.Index;
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
import com.google.common.collect.Sets;
|
|
|
|
|
|
|
|
|
|
@Entity
|
|
|
|
|
@Table(name = "FEEDS")
|
2013-03-21 08:55:53 +01:00
|
|
|
@SuppressWarnings("serial")
|
2013-03-23 01:49:39 +01:00
|
|
|
public class Feed extends AbstractModel {
|
2013-03-20 20:33:42 +01:00
|
|
|
|
2013-03-29 11:51:27 +01:00
|
|
|
@Column(length = 2048, nullable = false, unique = true)
|
|
|
|
|
@Index(name = "feed_index")
|
2013-03-20 20:33:42 +01:00
|
|
|
private String url;
|
|
|
|
|
|
|
|
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
|
|
|
private Date lastUpdated;
|
|
|
|
|
|
2013-03-25 12:24:00 +01:00
|
|
|
@Column(length = 1024)
|
|
|
|
|
private String message;
|
|
|
|
|
|
2013-03-26 11:36:31 +01:00
|
|
|
@OneToMany(mappedBy = "feed")
|
2013-03-20 20:33:42 +01:00
|
|
|
private Set<FeedEntry> entries = Sets.newHashSet();
|
|
|
|
|
|
2013-03-27 11:32:22 +01:00
|
|
|
@OneToMany(mappedBy = "feed")
|
|
|
|
|
private Set<FeedSubscription> subscriptions;
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
public Feed() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Feed(String url) {
|
|
|
|
|
this.url = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getUrl() {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setUrl(String url) {
|
|
|
|
|
this.url = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Date getLastUpdated() {
|
|
|
|
|
return lastUpdated;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setLastUpdated(Date lastUpdated) {
|
|
|
|
|
this.lastUpdated = lastUpdated;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Set<FeedEntry> getEntries() {
|
|
|
|
|
return entries;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setEntries(Set<FeedEntry> entries) {
|
|
|
|
|
this.entries = entries;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-25 12:24:00 +01:00
|
|
|
public String getMessage() {
|
|
|
|
|
return message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setMessage(String message) {
|
|
|
|
|
this.message = message;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-27 11:32:22 +01:00
|
|
|
public Set<FeedSubscription> getSubscriptions() {
|
|
|
|
|
return subscriptions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setSubscriptions(Set<FeedSubscription> subscriptions) {
|
|
|
|
|
this.subscriptions = subscriptions;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
}
|