package com.insoul.copartner.domain; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; /** * 项目评论 */ @Entity @Table(name = "project_comments", catalog = "copartner") public class ProjectComments extends BaseEntity { private static final long serialVersionUID = -8417698441177932601L; @Column(name = "project_id", nullable = false) private Long projectId; // 项目ID @Column(name = "user_id", nullable = false) private Long userId;// 评论人 @Column(name = "parent_id", nullable = false) private Long parentId = 0L;// 父级评论节点 @Column(nullable = false) private String content;// 内容 @Column(nullable = false) private String status = "active";// 状态 active 可用,inactive不可用 public Long getProjectId() { return projectId; } public void setProjectId(Long projectId) { this.projectId = projectId; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((content == null) ? 0 : content.hashCode()); result = prime * result + ((parentId == null) ? 0 : parentId.hashCode()); result = prime * result + ((projectId == null) ? 0 : projectId.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((userId == null) ? 0 : userId.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ProjectComments other = (ProjectComments) obj; if (content == null) { if (other.content != null) return false; } else if (!content.equals(other.content)) return false; if (parentId == null) { if (other.parentId != null) return false; } else if (!parentId.equals(other.parentId)) return false; if (projectId == null) { if (other.projectId != null) return false; } else if (!projectId.equals(other.projectId)) return false; if (status == null) { if (other.status != null) return false; } else if (!status.equals(other.status)) return false; if (userId == null) { if (other.userId != null) return false; } else if (!userId.equals(other.userId)) return false; return true; } }