yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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;
    }
}