mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
merge push infos into feeds
This commit is contained in:
@@ -6,10 +6,8 @@ import java.util.Set;
|
||||
import javax.persistence.Cacheable;
|
||||
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;
|
||||
@@ -73,15 +71,22 @@ public class Feed extends AbstractModel {
|
||||
@Column(length = 255)
|
||||
private String etagHeader;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY, mappedBy = "feed")
|
||||
private FeedPushInfo pushInfo;
|
||||
|
||||
@ManyToMany(mappedBy = "feeds")
|
||||
private Set<FeedEntry> entries = Sets.newHashSet();
|
||||
|
||||
@OneToMany(mappedBy = "feed")
|
||||
private Set<FeedSubscription> subscriptions;
|
||||
|
||||
@Column(length = 2048)
|
||||
private String pushHub;
|
||||
|
||||
@Column(length = 2048)
|
||||
@Index(name = "topic_index")
|
||||
private String pushTopic;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date pushLastPing;
|
||||
|
||||
public Feed() {
|
||||
|
||||
}
|
||||
@@ -186,12 +191,28 @@ public class Feed extends AbstractModel {
|
||||
this.lastUpdateSuccess = lastUpdateSuccess;
|
||||
}
|
||||
|
||||
public FeedPushInfo getPushInfo() {
|
||||
return pushInfo;
|
||||
public String getPushHub() {
|
||||
return pushHub;
|
||||
}
|
||||
|
||||
public void setPushInfo(FeedPushInfo pushInfo) {
|
||||
this.pushInfo = pushInfo;
|
||||
public void setPushHub(String pushHub) {
|
||||
this.pushHub = pushHub;
|
||||
}
|
||||
|
||||
public String getPushTopic() {
|
||||
return pushTopic;
|
||||
}
|
||||
|
||||
public void setPushTopic(String pushTopic) {
|
||||
this.pushTopic = pushTopic;
|
||||
}
|
||||
|
||||
public Date getPushLastPing() {
|
||||
return pushLastPing;
|
||||
}
|
||||
|
||||
public void setPushLastPing(Date pushLastPing) {
|
||||
this.pushLastPing = pushLastPing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
@Entity
|
||||
@Table(name = "FEEDPUSHINFOS")
|
||||
@SuppressWarnings("serial")
|
||||
@Cacheable
|
||||
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class FeedPushInfo extends AbstractModel {
|
||||
|
||||
@JoinColumn(unique = true)
|
||||
@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;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date lastPing;
|
||||
|
||||
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 Date getLastPing() {
|
||||
return lastPing;
|
||||
}
|
||||
|
||||
public void setLastPing(Date lastPing) {
|
||||
this.lastPing = lastPing;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user