remove many to many relationship between entries and feeds

This commit is contained in:
Athou
2013-07-24 15:39:20 +02:00
parent fdacac74cc
commit c2b53b117c
18 changed files with 350 additions and 251 deletions

View File

@@ -9,6 +9,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@@ -32,8 +33,8 @@ public class FeedEntry extends AbstractModel {
@Column(length = 40, nullable = false)
private String guidHash;
@OneToMany(mappedBy = "entry", cascade = CascadeType.REMOVE)
private Set<FeedFeedEntry> feedRelationships;
@ManyToOne(fetch = FetchType.LAZY)
private Feed feed;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = false)
@JoinColumn(nullable = false, updatable = false)
@@ -124,12 +125,12 @@ public class FeedEntry extends AbstractModel {
this.author = author;
}
public Set<FeedFeedEntry> getFeedRelationships() {
return feedRelationships;
public Feed getFeed() {
return feed;
}
public void setFeedRelationships(Set<FeedFeedEntry> feedRelationships) {
this.feedRelationships = feedRelationships;
public void setFeed(Feed feed) {
this.feed = feed;
}
public FeedSubscription getSubscription() {