package com.qxueyou.scc.operation.comment.mode;
|
|
import java.io.Serializable;
|
import java.math.BigInteger;
|
import java.util.Date;
|
import java.util.List;
|
|
import javax.persistence.Column;
|
import javax.persistence.Entity;
|
import javax.persistence.GeneratedValue;
|
import javax.persistence.Id;
|
import javax.persistence.NamedQuery;
|
import javax.persistence.Table;
|
import javax.persistence.Transient;
|
|
import org.hibernate.annotations.GenericGenerator;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import com.qxueyou.scc.base.model.ITrace;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
/**
|
* 评论表 实体
|
* @author ody.yuan
|
*
|
*/
|
@Entity
|
@Table(name="sns_comment")
|
@NamedQuery(name="Comment.findAll", query="SELECT e FROM Comment e")
|
public class Comment implements Serializable,ITrace {
|
|
|
public static final Integer COMMENT_LEVEL_FIRST = 1;
|
|
public static final Integer COMMENT_LEVEL_SECOND = 2;
|
|
private static final long serialVersionUID = 1L;
|
|
/** 主键 */
|
@Id
|
@GeneratedValue(generator = "hibernate-uuid")
|
@GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
|
@Column(name="COMMENT_ID", unique=true, nullable=false, length=32)
|
private String commentId;
|
|
/** 评论对象ID */
|
@Column(name="COMMENT_OBJECT_ID", length=32)
|
private String commentObjectId;
|
|
/** 评论者ID */
|
@Column(name="COMMENTTER_ID", length=32)
|
private String commentterId;
|
|
/** 评论者 */
|
@Column(name="COMMENTTER", length=150)
|
private String commentter;
|
|
/** 评论者头像 */
|
@Column(name="COMMENTTER_HEADIMG", length=255)
|
private String commentterHeadimg;
|
|
/** 被评论者ID */
|
@Column(name="COMMENTED_ID", length=32)
|
private String commentedId;
|
|
/** 被评论人为Common 表示公共的对象id 适用于点赞时直接点赞对象 而不是点赞某个人的评论 */
|
public static final String COMMENTED_ID_COMMON = "Common";
|
|
/** 被评论者 */
|
@Column(name="COMMENTED_NAME", length=150)
|
private String commentedName;
|
|
/** 评论层级 */
|
@Column(name="COMMENT_LEVEL")
|
private Integer commentLevel ;
|
|
/** 评论时间 */
|
@Column(name="COMMENT_TIME", nullable=false)
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private Date commentTime;
|
|
/** 评论内容 */
|
@Column(name="CONTENT")
|
private String content;
|
|
/** 是否通过审核(0、已发布 1、未审核) */
|
@Column(name="PASS_REVIEW_FLAG", nullable=false)
|
private boolean passReviewFlag;
|
|
/** 是否需要审核(0、不需要 1、需要) */
|
@Column(name="REVIEW_FLAG", nullable=false)
|
private boolean reviewFlag;
|
|
/** 来源 */
|
@Column(name="SOURCE")
|
private String source;
|
|
/** 班级Id */
|
@Column(name="CLASS_ID")
|
private String classId;
|
|
/** 评论上一级评论ID */
|
@Column(name="COMMENT_PARENT_ID", length=32)
|
private String commentParentId;
|
|
/** 创建者ID */
|
@Column(name="CREATE_ID", nullable=false, length=32)
|
@JsonIgnore
|
private String createId;
|
|
/** 创建时间 */
|
@Column(name="CREATE_TIME", nullable=false)
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonIgnore
|
private Date createTime;
|
|
/** 创建人 */
|
@Column(name="CREATOR", nullable=false, length=100)
|
@JsonIgnore
|
private String creator;
|
|
/** 修改人ID */
|
@Column(name="UPDATE_ID", length=32)
|
@JsonIgnore
|
private String updateId;
|
|
/** 修改时间 */
|
@Column(name="UPDATE_TIME", nullable=false)
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonIgnore
|
private Date updateTime;
|
|
/** 修改人 */
|
@Column(name="UPDATOR", length=100)
|
@JsonIgnore
|
private String updator;
|
|
/** 删除标志 */
|
@Column(name="DELETE_FLAG", nullable=false)
|
@JsonIgnore
|
private boolean deleteFlag;
|
|
/** 评论个数 */
|
@Column(name="COMMENT_COUNT")
|
private BigInteger commentCount;
|
|
/** 评论被赞数 */
|
@Column(name="COMMENT_PRAISE_COUNT")
|
private BigInteger commentPraiseCount;
|
|
/** 子评论 */
|
@Transient
|
private List<Comment> childComments;
|
|
/** 评论对象评论总数 */
|
@Transient
|
private BigInteger parCommentCount;
|
|
/** 评论对象赞总数 */
|
@Transient
|
private BigInteger parPraiseCount;
|
|
/** 是否赞 */
|
@Transient
|
private boolean praise;
|
|
/** 是否赞 */
|
@Transient
|
private int pageOrder;
|
|
public String getCommentId() {
|
return commentId;
|
}
|
|
public void setCommentId(String commentId) {
|
this.commentId = commentId;
|
}
|
|
public String getCommentObjectId() {
|
return commentObjectId;
|
}
|
|
public void setCommentObjectId(String commentObjectId) {
|
this.commentObjectId = commentObjectId;
|
}
|
|
public String getCommentterId() {
|
return commentterId;
|
}
|
|
public void setCommentterId(String commentterId) {
|
this.commentterId = commentterId;
|
}
|
|
public String getCommentter() {
|
return commentter;
|
}
|
|
public void setCommentter(String commentter) {
|
this.commentter = commentter;
|
}
|
|
public String getCommentterHeadimg() {
|
return commentterHeadimg;
|
}
|
|
public void setCommentterHeadimg(String commentterHeadimg) {
|
this.commentterHeadimg = commentterHeadimg;
|
}
|
|
public Date getCommentTime() {
|
return commentTime;
|
}
|
|
public void setCommentTime(Date commentTime) {
|
this.commentTime = commentTime;
|
}
|
|
public String getContent() {
|
return content;
|
}
|
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
public String getCommentParentId() {
|
return commentParentId;
|
}
|
|
public void setCommentParentId(String commentParentId) {
|
this.commentParentId = commentParentId;
|
}
|
|
public String getCreateId() {
|
return createId;
|
}
|
|
public void setCreateId(String createId) {
|
this.createId = createId;
|
}
|
|
public Date getCreateTime() {
|
return createTime;
|
}
|
|
public void setCreateTime(Date createTime) {
|
this.createTime = createTime;
|
}
|
|
public String getCreator() {
|
return creator;
|
}
|
|
public void setCreator(String creator) {
|
this.creator = creator;
|
}
|
|
public String getUpdateId() {
|
return updateId;
|
}
|
|
public void setUpdateId(String updateId) {
|
this.updateId = updateId;
|
}
|
|
public Date getUpdateTime() {
|
return updateTime;
|
}
|
|
public void setUpdateTime(Date updateTime) {
|
this.updateTime = updateTime;
|
}
|
|
public String getUpdator() {
|
return updator;
|
}
|
|
public void setUpdator(String updator) {
|
this.updator = updator;
|
}
|
|
public boolean getDeleteFlag() {
|
return deleteFlag;
|
}
|
|
public void setDeleteFlag(boolean deleteFlag) {
|
this.deleteFlag = deleteFlag;
|
}
|
|
public List<Comment> getChildComments() {
|
return childComments;
|
}
|
|
public void setChildComments(List<Comment> childComments) {
|
this.childComments = childComments;
|
}
|
|
public BigInteger getCommentCount() {
|
return commentCount;
|
}
|
|
public void setCommentCount(BigInteger commentCount) {
|
this.commentCount = commentCount;
|
}
|
|
public BigInteger getCommentPraiseCount() {
|
return commentPraiseCount;
|
}
|
|
public void setCommentPraiseCount(BigInteger commentPraiseCount) {
|
this.commentPraiseCount = commentPraiseCount;
|
}
|
|
public BigInteger getParCommentCount() {
|
return parCommentCount;
|
}
|
|
public void setParCommentCount(BigInteger parCommentCount) {
|
this.parCommentCount = parCommentCount;
|
}
|
|
public BigInteger getParPraiseCount() {
|
return parPraiseCount;
|
}
|
|
public void setParPraiseCount(BigInteger parPraiseCount) {
|
this.parPraiseCount = parPraiseCount;
|
}
|
|
public boolean getPraise() {
|
return praise;
|
}
|
|
public void setPraise(boolean praise) {
|
this.praise = praise;
|
}
|
|
public String getCommentedId() {
|
return commentedId;
|
}
|
|
public void setCommentedId(String commentedId) {
|
this.commentedId = commentedId;
|
}
|
|
public String getCommentedName() {
|
return commentedName;
|
}
|
|
public void setCommentedName(String commentedName) {
|
this.commentedName = commentedName;
|
}
|
|
public Integer getCommentLevel() {
|
return commentLevel;
|
}
|
|
public void setCommentLevel(Integer commentLevel) {
|
this.commentLevel = commentLevel;
|
}
|
|
public boolean isPassReviewFlag() {
|
return passReviewFlag;
|
}
|
|
public void setPassReviewFlag(boolean passReviewFlag) {
|
this.passReviewFlag = passReviewFlag;
|
}
|
|
public boolean isReviewFlag() {
|
return reviewFlag;
|
}
|
|
public void setReviewFlag(boolean reviewFlag) {
|
this.reviewFlag = reviewFlag;
|
}
|
|
public String getSource() {
|
return source;
|
}
|
|
public void setSource(String source) {
|
this.source = source;
|
}
|
|
public String getClassId() {
|
return classId;
|
}
|
|
public void setClassId(String classId) {
|
this.classId = classId;
|
}
|
|
public int getPageOrder() {
|
return pageOrder;
|
}
|
|
public void setPageOrder(int pageOrder) {
|
this.pageOrder = pageOrder;
|
}
|
|
}
|