2013-04-11 10:27:20 +02:00
|
|
|
package com.commafeed.backend.model;
|
|
|
|
|
|
2013-07-24 15:39:20 +02:00
|
|
|
import java.util.Set;
|
|
|
|
|
|
2013-04-11 10:27:20 +02:00
|
|
|
import javax.persistence.Column;
|
|
|
|
|
import javax.persistence.Entity;
|
|
|
|
|
import javax.persistence.Lob;
|
2013-07-24 15:39:20 +02:00
|
|
|
import javax.persistence.OneToMany;
|
2013-04-11 10:27:20 +02:00
|
|
|
import javax.persistence.Table;
|
|
|
|
|
|
2022-01-02 21:45:21 +01:00
|
|
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
2019-04-22 20:30:06 +02:00
|
|
|
import org.hibernate.annotations.Type;
|
|
|
|
|
|
2013-08-11 14:01:16 +02:00
|
|
|
import lombok.Getter;
|
|
|
|
|
import lombok.Setter;
|
2013-08-11 12:09:05 +02:00
|
|
|
|
2013-04-11 10:27:20 +02:00
|
|
|
@Entity
|
|
|
|
|
@Table(name = "FEEDENTRYCONTENTS")
|
|
|
|
|
@SuppressWarnings("serial")
|
2013-08-11 14:01:16 +02:00
|
|
|
@Getter
|
|
|
|
|
@Setter
|
2013-04-11 10:27:20 +02:00
|
|
|
public class FeedEntryContent extends AbstractModel {
|
|
|
|
|
|
|
|
|
|
@Column(length = 2048)
|
|
|
|
|
private String title;
|
2013-08-01 11:17:45 +02:00
|
|
|
|
2013-07-26 08:15:23 +02:00
|
|
|
@Column(length = 40)
|
|
|
|
|
private String titleHash;
|
2013-04-11 10:27:20 +02:00
|
|
|
|
|
|
|
|
@Lob
|
|
|
|
|
@Column(length = Integer.MAX_VALUE)
|
2019-04-22 20:30:06 +02:00
|
|
|
@Type(type = "org.hibernate.type.TextType")
|
2013-04-11 10:27:20 +02:00
|
|
|
private String content;
|
|
|
|
|
|
2013-07-24 15:39:20 +02:00
|
|
|
@Column(length = 40)
|
|
|
|
|
private String contentHash;
|
|
|
|
|
|
|
|
|
|
@Column(name = "author", length = 128)
|
|
|
|
|
private String author;
|
|
|
|
|
|
2013-04-11 10:27:20 +02:00
|
|
|
@Column(length = 2048)
|
|
|
|
|
private String enclosureUrl;
|
|
|
|
|
|
|
|
|
|
@Column(length = 255)
|
|
|
|
|
private String enclosureType;
|
|
|
|
|
|
2022-01-02 12:45:56 +01:00
|
|
|
@Lob
|
|
|
|
|
@Column(length = Integer.MAX_VALUE)
|
|
|
|
|
@Type(type = "org.hibernate.type.TextType")
|
|
|
|
|
private String mediaDescription;
|
|
|
|
|
|
|
|
|
|
@Column(length = 2048)
|
|
|
|
|
private String mediaThumbnailUrl;
|
|
|
|
|
|
|
|
|
|
private Integer mediaThumbnailWidth;
|
|
|
|
|
private Integer mediaThumbnailHeight;
|
|
|
|
|
|
2015-05-03 09:17:54 +02:00
|
|
|
@Column(length = 4096)
|
|
|
|
|
private String categories;
|
|
|
|
|
|
2013-07-24 15:39:20 +02:00
|
|
|
@OneToMany(mappedBy = "content")
|
|
|
|
|
private Set<FeedEntry> entries;
|
|
|
|
|
|
2022-01-02 21:45:21 +01:00
|
|
|
public boolean equivalentTo(FeedEntryContent c) {
|
|
|
|
|
if (c == null) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new EqualsBuilder().append(title, c.title)
|
|
|
|
|
.append(content, c.content)
|
|
|
|
|
.append(author, c.author)
|
|
|
|
|
.append(enclosureUrl, c.enclosureUrl)
|
|
|
|
|
.append(enclosureType, c.enclosureType)
|
|
|
|
|
.append(mediaDescription, c.mediaDescription)
|
|
|
|
|
.append(mediaThumbnailUrl, c.mediaThumbnailUrl)
|
|
|
|
|
.append(mediaThumbnailWidth, c.mediaThumbnailWidth)
|
|
|
|
|
.append(mediaThumbnailHeight, c.mediaThumbnailHeight)
|
|
|
|
|
.append(categories, c.categories)
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-11 10:27:20 +02:00
|
|
|
}
|