2013-03-23 16:17:19 +01:00
|
|
|
package com.commafeed.backend.model;
|
2013-03-20 20:33:42 +01:00
|
|
|
|
2013-04-08 15:23:52 +02:00
|
|
|
import java.util.Set;
|
|
|
|
|
|
2013-06-19 18:44:56 +02:00
|
|
|
import javax.persistence.Cacheable;
|
2013-04-08 15:23:52 +02:00
|
|
|
import javax.persistence.CascadeType;
|
2013-03-20 20:33:42 +01:00
|
|
|
import javax.persistence.Column;
|
|
|
|
|
import javax.persistence.Entity;
|
2013-05-15 16:26:18 +02:00
|
|
|
import javax.persistence.FetchType;
|
2013-03-29 11:51:27 +01:00
|
|
|
import javax.persistence.JoinColumn;
|
2013-03-20 20:33:42 +01:00
|
|
|
import javax.persistence.ManyToOne;
|
2013-04-08 15:23:52 +02:00
|
|
|
import javax.persistence.OneToMany;
|
2013-03-20 20:33:42 +01:00
|
|
|
import javax.persistence.Table;
|
|
|
|
|
|
2013-06-19 18:44:56 +02:00
|
|
|
import org.hibernate.annotations.Cache;
|
|
|
|
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
@Entity
|
|
|
|
|
@Table(name = "FEEDSUBSCRIPTIONS")
|
2013-03-21 08:55:53 +01:00
|
|
|
@SuppressWarnings("serial")
|
2013-06-19 18:44:56 +02:00
|
|
|
@Cacheable
|
|
|
|
|
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
|
2013-03-23 01:49:39 +01:00
|
|
|
public class FeedSubscription extends AbstractModel {
|
2013-03-20 20:33:42 +01:00
|
|
|
|
2013-05-15 16:26:18 +02:00
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
2013-03-29 11:51:27 +01:00
|
|
|
@JoinColumn(nullable = false)
|
2013-03-20 20:33:42 +01:00
|
|
|
private User user;
|
|
|
|
|
|
2013-05-15 16:26:18 +02:00
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
2013-03-29 11:51:27 +01:00
|
|
|
@JoinColumn(nullable = false)
|
2013-03-20 20:33:42 +01:00
|
|
|
private Feed feed;
|
|
|
|
|
|
2013-03-29 11:51:27 +01:00
|
|
|
@Column(length = 128, nullable = false)
|
2013-03-20 20:33:42 +01:00
|
|
|
private String title;
|
|
|
|
|
|
2013-05-15 16:26:18 +02:00
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
2013-03-20 20:33:42 +01:00
|
|
|
private FeedCategory category;
|
|
|
|
|
|
2013-04-08 15:23:52 +02:00
|
|
|
@OneToMany(mappedBy = "subscription", cascade = CascadeType.REMOVE)
|
|
|
|
|
private Set<FeedEntryStatus> statuses;
|
|
|
|
|
|
2013-06-01 21:00:10 +02:00
|
|
|
private Integer position;
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
public Feed getFeed() {
|
|
|
|
|
return feed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setFeed(Feed feed) {
|
|
|
|
|
this.feed = feed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public User getUser() {
|
|
|
|
|
return user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setUser(User user) {
|
|
|
|
|
this.user = user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTitle() {
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTitle(String title) {
|
|
|
|
|
this.title = title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public FeedCategory getCategory() {
|
|
|
|
|
return category;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setCategory(FeedCategory category) {
|
|
|
|
|
this.category = category;
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-08 15:23:52 +02:00
|
|
|
public Set<FeedEntryStatus> getStatuses() {
|
|
|
|
|
return statuses;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setStatuses(Set<FeedEntryStatus> statuses) {
|
|
|
|
|
this.statuses = statuses;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-01 21:00:10 +02:00
|
|
|
public Integer getPosition() {
|
|
|
|
|
return position;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setPosition(Integer position) {
|
|
|
|
|
this.position = position;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
}
|