mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
initial pubsubhubbub support (#44)
This commit is contained in:
@@ -3,10 +3,13 @@ package com.commafeed.backend.model;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
@@ -64,6 +67,10 @@ public class Feed extends AbstractModel {
|
||||
@Column(length = 255)
|
||||
private String etagHeader;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY, mappedBy = "feed", cascade = {
|
||||
CascadeType.PERSIST, CascadeType.MERGE })
|
||||
private FeedPushInfo pushInfo;
|
||||
|
||||
@ManyToMany(mappedBy = "feeds")
|
||||
private Set<FeedEntry> entries = Sets.newHashSet();
|
||||
|
||||
@@ -174,4 +181,12 @@ public class Feed extends AbstractModel {
|
||||
this.lastUpdateSuccess = lastUpdateSuccess;
|
||||
}
|
||||
|
||||
public FeedPushInfo getPushInfo() {
|
||||
return pushInfo;
|
||||
}
|
||||
|
||||
public void setPushInfo(FeedPushInfo pushInfo) {
|
||||
this.pushInfo = pushInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
60
src/main/java/com/commafeed/backend/model/FeedPushInfo.java
Normal file
60
src/main/java/com/commafeed/backend/model/FeedPushInfo.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
@Entity
|
||||
@Table(name = "FEEDPUSHINFOS")
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedPushInfo extends AbstractModel {
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
private Feed feed;
|
||||
|
||||
@Column(length = 2048, nullable = false)
|
||||
@Index(name = "topic_index")
|
||||
private String topic;
|
||||
|
||||
@Column(length = 2048, nullable = false)
|
||||
private String hub;
|
||||
|
||||
private boolean active;
|
||||
|
||||
public String getTopic() {
|
||||
return topic;
|
||||
}
|
||||
|
||||
public void setTopic(String topic) {
|
||||
this.topic = topic;
|
||||
}
|
||||
|
||||
public Feed getFeed() {
|
||||
return feed;
|
||||
}
|
||||
|
||||
public void setFeed(Feed feed) {
|
||||
this.feed = feed;
|
||||
}
|
||||
|
||||
public String getHub() {
|
||||
return hub;
|
||||
}
|
||||
|
||||
public void setHub(String hub) {
|
||||
this.hub = hub;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user