日期:2014-05-17 浏览次数:20932 次
@Entity
@Table(name = "ibokee_report_comment")
@Searchable
@XmlRootElement
public class ReportComment implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/** 日志评论 */
private ArticleComment article;
/** 照片评论 */
private PhotoComment photo;
/** 微博评论 */
private PostComment post;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@SearchableId
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "article")
public ArticleComment getArticle() {
return article;
}
public void setArticle(ArticleComment article) {
this.article = article;
}
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "photo")
public PhotoComment getPhoto() {
return photo;
}
public void setPhoto(PhotoComment photo) {
this.photo = photo;
}
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "post")
public PostComment getPost() {
return post;
}
public void setPost(PostComment post) {
this.post = post;
}
}
@Entity
@Table(name = "ibokee_wb_postcomment")
@Searchable
@XmlRootElement
public class PostComment implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private Post post;
private User user;
private String content;
private Date createTime;
private Boolean del = Boolean.FALSE;
/** 评论回复 */
private PostComment parent;
public PostComment() {
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@SearchableId
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "post")
public Post getPost() {
return post;
}
public void setPost(Post post) {
this.post = post;
}
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user")
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
@Column
public String getContent() {