mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
using hibernate to fetch entries now, able to fetch entries in one go
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import org.apache.commons.codec.binary.StringUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "FEEDENTRIES")
|
||||
@SuppressWarnings("serial")
|
||||
@@ -26,7 +30,7 @@ public class FeedEntry extends AbstractModel {
|
||||
private String title;
|
||||
|
||||
@Lob
|
||||
private String content;
|
||||
private byte[] content;
|
||||
|
||||
@Column(length = 2048)
|
||||
private String url;
|
||||
@@ -34,6 +38,9 @@ public class FeedEntry extends AbstractModel {
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date updated;
|
||||
|
||||
@OneToMany(mappedBy = "entry")
|
||||
private Set<FeedEntryStatus> statuses;
|
||||
|
||||
public String getGuid() {
|
||||
return guid;
|
||||
}
|
||||
@@ -51,11 +58,11 @@ public class FeedEntry extends AbstractModel {
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
return StringUtils.newStringUtf8(content);
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
this.content = StringUtils.getBytesUtf8(content);
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
@@ -82,4 +89,12 @@ public class FeedEntry extends AbstractModel {
|
||||
this.feed = feed;
|
||||
}
|
||||
|
||||
public Set<FeedEntryStatus> getStatuses() {
|
||||
return statuses;
|
||||
}
|
||||
|
||||
public void setStatuses(Set<FeedEntryStatus> statuses) {
|
||||
this.statuses = statuses;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user