package com.yeshi.fanli.entity.bus.recommend;
|
|
import java.util.HashSet;
|
import java.util.Set;
|
|
import javax.persistence.CascadeType;
|
import javax.persistence.Column;
|
import javax.persistence.Entity;
|
import javax.persistence.FetchType;
|
import javax.persistence.GeneratedValue;
|
import javax.persistence.GenerationType;
|
import javax.persistence.Id;
|
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinTable;
|
import javax.persistence.ManyToMany;
|
import javax.persistence.ManyToOne;
|
import javax.persistence.OneToMany;
|
import javax.persistence.Table;
|
import javax.persistence.Transient;
|
import javax.persistence.UniqueConstraint;
|
|
import com.google.gson.annotations.Expose;
|
import com.yeshi.fanli.entity.bus.user.UserInfo;
|
|
/**
|
* 推荐回复
|
* @author ChenX
|
*
|
*/
|
/**
|
* @author ChenX
|
*
|
*/
|
@Entity
|
@Table(name="yeshi_ec_recommend_reply")
|
public class RecommendReply {
|
@Id
|
@GeneratedValue(strategy=GenerationType.AUTO)
|
@Expose
|
private long id;
|
@Expose
|
@ManyToOne(fetch = FetchType.EAGER)
|
@JoinColumn(name="`replier`")
|
private UserInfo replier; //回复人
|
@Expose
|
private long replyTime; //回复时间
|
@Expose
|
@Column(name="`content`",length=1024)
|
private String content; //回复内容
|
|
@Column(name="zan_count")
|
private int zanCount; //点赞数量
|
|
@ManyToOne(fetch = FetchType.EAGER)
|
@JoinColumn(name="rd_id")
|
private RecommendDetails recommendDetails;
|
|
@ManyToMany(fetch=FetchType.LAZY)
|
@JoinTable(name="yeshi_ec_recommend_replys_u_zan",joinColumns={@JoinColumn(name="rid")},inverseJoinColumns={@JoinColumn(name="uid")},uniqueConstraints={@UniqueConstraint(columnNames={"rid","uid"})})
|
private Set<UserInfo> zanUserInfos = new HashSet<UserInfo>(); //点过赞的用户
|
|
@OneToMany(fetch=FetchType.EAGER,cascade=CascadeType.REMOVE)
|
@JoinTable(name="yeshi_ec_recommend_replys_replys",joinColumns={@JoinColumn(name="rid")},inverseJoinColumns={@JoinColumn(name="r_rid")},uniqueConstraints={@UniqueConstraint(columnNames={"rid","r_rid"})})
|
private Set<RecommendReply> recommendReplys=new HashSet<RecommendReply>();
|
|
@Transient
|
private boolean isZan;
|
|
public RecommendReply() {
|
|
}
|
|
public RecommendReply(long id) {
|
super();
|
this.id = id;
|
}
|
|
public long getId() {
|
return id;
|
}
|
|
public RecommendDetails getRecommendDetails() {
|
return recommendDetails;
|
}
|
|
public void setRecommendDetails(RecommendDetails recommendDetails) {
|
this.recommendDetails = recommendDetails;
|
}
|
|
public void setId(long id) {
|
this.id = id;
|
}
|
|
public UserInfo getReplier() {
|
return replier;
|
}
|
|
public void setReplier(UserInfo replier) {
|
this.replier = replier;
|
}
|
|
public boolean isZan() {
|
return isZan;
|
}
|
|
public void setZan(boolean isZan) {
|
this.isZan = isZan;
|
}
|
|
public long getReplyTime() {
|
return replyTime;
|
}
|
|
public void setReplyTime(long replyTime) {
|
this.replyTime = replyTime;
|
}
|
|
public String getContent() {
|
return content;
|
}
|
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
public int getZanCount() {
|
return zanCount;
|
}
|
|
public void setZanCount(int zanCount) {
|
this.zanCount = zanCount;
|
}
|
|
public Set<UserInfo> getZanUserInfos() {
|
return zanUserInfos;
|
}
|
|
public void setZanUserInfos(Set<UserInfo> zanUserInfos) {
|
this.zanUserInfos = zanUserInfos;
|
}
|
|
public Set<RecommendReply> getRecommendReplys() {
|
return recommendReplys;
|
}
|
|
public void setRecommendReplys(Set<RecommendReply> recommendReplys) {
|
this.recommendReplys = recommendReplys;
|
}
|
}
|