package com.yeshi.fanli.entity.bus.recommend;
|
|
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.ManyToOne;
|
import javax.persistence.Table;
|
|
import com.yeshi.fanli.entity.bus.user.UserInfo;
|
@Entity
|
@Table(name="yeshi_ec_dynamic_recommend_like")
|
public class RecommendLike {
|
@Id
|
@GeneratedValue(strategy=GenerationType.AUTO)
|
private long id;
|
@ManyToOne
|
@JoinColumn(name="uid")
|
private UserInfo userInfo;
|
|
@JoinColumn(name="dr_id")
|
@ManyToOne(fetch=FetchType.EAGER)
|
private DynamicRecommend dynamicRecommend;
|
|
private long createtime;
|
|
public RecommendLike() {
|
// TODO Auto-generated constructor stub
|
}
|
|
public RecommendLike(UserInfo userInfo, DynamicRecommend dynamicRecommend) {
|
super();
|
this.userInfo = userInfo;
|
this.dynamicRecommend = dynamicRecommend;
|
}
|
|
public long getId() {
|
return id;
|
}
|
public void setId(long id) {
|
this.id = id;
|
}
|
public UserInfo getUserInfo() {
|
return userInfo;
|
}
|
public void setUserInfo(UserInfo userInfo) {
|
this.userInfo = userInfo;
|
}
|
public DynamicRecommend getDynamicRecommend() {
|
return dynamicRecommend;
|
}
|
public void setDynamicRecommend(DynamicRecommend dynamicRecommend) {
|
this.dynamicRecommend = dynamicRecommend;
|
}
|
public long getCreatetime() {
|
return createtime;
|
}
|
public void setCreatetime(long createtime) {
|
this.createtime = createtime;
|
}
|
@Override
|
public int hashCode() {
|
final int prime = 31;
|
int result = 1;
|
result = prime
|
* result
|
+ ((dynamicRecommend == null) ? 0 : dynamicRecommend.hashCode());
|
result = prime * result
|
+ ((userInfo == null) ? 0 : userInfo.hashCode());
|
return result;
|
}
|
@Override
|
public boolean equals(Object obj) {
|
if (this == obj)
|
return true;
|
if (obj == null)
|
return false;
|
if (getClass() != obj.getClass())
|
return false;
|
RecommendLike other = (RecommendLike) obj;
|
if (dynamicRecommend == null) {
|
if (other.dynamicRecommend != null)
|
return false;
|
} else if (!dynamicRecommend.equals(other.dynamicRecommend))
|
return false;
|
if (userInfo == null) {
|
if (other.userInfo != null)
|
return false;
|
} else if (!userInfo.equals(other.userInfo))
|
return false;
|
return true;
|
}
|
|
}
|