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
package com.yeshi.fanli.entity.bus.recommend;
 
import java.util.ArrayList;
import java.util.List;
 
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.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
 
import org.hibernate.annotations.Type;
 
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.bus.user.UserInfo;
/**
 * 推荐的详
 * @author ChenX
 *
 */
@Entity
@Table(name="yeshi_ec_recommend_details")
public class RecommendDetails {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="id")
    @Type(type="long")
    @Expose
    private long id;
    @OneToOne(fetch=FetchType.EAGER,cascade=CascadeType.REMOVE)
    @JoinColumn(name="`dr_id`")
    @Expose
    private DynamicRecommend dynamicRecommend; //对应的动态推
    @Expose
    private int goodCount; 
    @Expose
    private int badCount; 
    
    @ManyToMany(fetch=FetchType.EAGER)
    @JoinTable(name="yeshi_ec_recommend_details_voteuid",joinColumns={@JoinColumn(name="did")},inverseJoinColumns={@JoinColumn(name="uid")},uniqueConstraints={@UniqueConstraint(columnNames={"did","uid"})})
    private List<UserInfo> voteUserInfos = new ArrayList<UserInfo>(); //投过值或不的用
    @Expose
    @OneToMany(mappedBy="recommendDetails",fetch=FetchType.LAZY,cascade=CascadeType.REMOVE)
    private List<RecommendReply> recommendReplys = new ArrayList<RecommendReply>(); //推荐的回
    @Expose
    @Transient
    private boolean isVote;
    
    public RecommendDetails() {
    }
    
    public RecommendDetails(long id) {
        super();
        this.id = id;
    }
 
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    
    public List<UserInfo> getVoteUserInfos() {
        return voteUserInfos;
    }
 
    public void setVoteUserInfos(List<UserInfo> voteUserInfos) {
        this.voteUserInfos = voteUserInfos;
    }
 
    public List<RecommendReply> getRecommendReplys() {
        return recommendReplys;
    }
 
    public void setRecommendReplys(List<RecommendReply> recommendReplys) {
        this.recommendReplys = recommendReplys;
    }
 
    public boolean isVote() {
        return isVote;
    }
    public void setVote(boolean isVote) {
        this.isVote = isVote;
    }
    public DynamicRecommend getDynamicRecommend() {
        return dynamicRecommend;
    }
    public void setDynamicRecommend(DynamicRecommend dynamicRecommend) {
        this.dynamicRecommend = dynamicRecommend;
    }
    public int getGoodCount() {
        return goodCount;
    }
    public void setGoodCount(int goodCount) {
        this.goodCount = goodCount;
    }
    public int getBadCount() {
        return badCount;
    }
    public void setBadCount(int badCount) {
        this.badCount = badCount;
    }
    
}