mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
smarter feed entry storing (fixes #10)
This commit is contained in:
@@ -5,9 +5,11 @@ import java.util.Set;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
@@ -15,6 +17,8 @@ import javax.persistence.TemporalType;
|
||||
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
import com.google.api.client.util.Sets;
|
||||
|
||||
@Entity
|
||||
@Table(name = "FEEDENTRIES")
|
||||
@SuppressWarnings("serial")
|
||||
@@ -23,9 +27,9 @@ public class FeedEntry extends AbstractModel {
|
||||
@Column(length = 2048, nullable = false)
|
||||
private String guid;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(nullable = false)
|
||||
private Feed feed;
|
||||
@ManyToMany(fetch = FetchType.EAGER)
|
||||
@JoinTable(name = "FEED_FEEDENTRIES", joinColumns = { @JoinColumn(name = "FEED_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "FEEDENTRY_ID", nullable = false, updatable = false) })
|
||||
private Set<Feed> feeds = Sets.newHashSet();
|
||||
|
||||
@Column(length = 2048)
|
||||
private String title;
|
||||
@@ -84,12 +88,12 @@ public class FeedEntry extends AbstractModel {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
public Feed getFeed() {
|
||||
return feed;
|
||||
public Set<Feed> getFeeds() {
|
||||
return feeds;
|
||||
}
|
||||
|
||||
public void setFeed(Feed feed) {
|
||||
this.feed = feed;
|
||||
public void setFeeds(Set<Feed> feeds) {
|
||||
this.feeds = feeds;
|
||||
}
|
||||
|
||||
public Set<FeedEntryStatus> getStatuses() {
|
||||
|
||||
Reference in New Issue
Block a user