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-30 20:51:51 +01:00
|
|
|
import javax.persistence.Transient;
|
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-31 08:45:55 +02:00
|
|
|
@Column(length = 2048, nullable = false)
|
2013-03-20 20:33:42 +01:00
|
|
|
private String url;
|
|
|
|
|
|
2013-03-30 20:51:51 +01:00
|
|
|
@Transient
|
|
|
|
|
private String title;
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
@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-30 20:51:51 +01:00
|
|
|
public String getTitle() {
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTitle(String title) {
|
|
|
|
|
this.title = title;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
}
|