package com.ssj.bean.weixin.story.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;


import com.ssj.bean.common.framework.core.domain.BaseEntity;

@Entity
@Table(name = "tb_story_card")
public class StoryCard  extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1276491913144565025L;
	private String storyTaskId;
	private String storyId;
	private String content;
	private String userId;
	private String voice;
	private Date createTime;
	private Integer daysNum;
	private Integer praise;
	private String coorx;
	private String coory;
	private String coorName;
    private String userName;
    private String userPhoto;
    private String img;
    private Date shareTime;
	private List<StoryCardReply> replyList = new ArrayList<StoryCardReply>();
	private List<StoryCardPraise> praiseList = new ArrayList<StoryCardPraise>();
	private List<StoryImg> imglist = new ArrayList<StoryImg>();
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@JSONField(format = "MM月dd日")
	@Column(updatable =false)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@OneToMany(cascade = { CascadeType.REFRESH}, fetch=FetchType.EAGER)
	@JoinColumn(name="storyCardId",updatable =false,insertable =false)
	@OrderBy(" createTime DESC")
	@Fetch(FetchMode.SUBSELECT)
	public List<StoryCardReply> getReplyList() {
		return replyList;
	}
	public void setReplyList(List<StoryCardReply> replyList) {
		this.replyList = replyList;
	}
	public Integer getDaysNum() {
		return daysNum;
	}
	public void setDaysNum(Integer daysNum) {
		this.daysNum = daysNum;
	}
	public String getStoryTaskId() {
		return storyTaskId;
	}
	public void setStoryTaskId(String storyTaskId) {
		this.storyTaskId = storyTaskId;
	}
	public String getVoice() {
		return voice;
	}
	public void setVoice(String voice) {
		this.voice = voice;
	}
	@OneToMany(cascade = { CascadeType.REFRESH}, fetch=FetchType.EAGER)
	@JoinColumn(name="objectId",updatable =false,insertable =false)
	@OrderBy(" num ASC")
	@Fetch(FetchMode.SUBSELECT)
	public List<StoryImg> getImglist() {
		return imglist;
	}
	public void setImglist(List<StoryImg> imglist) {
		this.imglist = imglist;
	}
	public Integer getPraise() {
		return praise;
	}
	public void setPraise(Integer praise) {
		this.praise = praise;
	}
	
	public String getCoorx() {
		return coorx;
	}
	public void setCoorx(String coorx) {
		this.coorx = coorx;
	}
	public String getCoory() {
		return coory;
	}
	public void setCoory(String coory) {
		this.coory = coory;
	}
	public String getCoorName() {
		return coorName;
	}
	public void setCoorName(String coorName) {
		this.coorName = coorName;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getUserPhoto() {
		return userPhoto;
	}
	public void setUserPhoto(String userPhoto) {
		this.userPhoto = userPhoto;
	}
	public String getStoryId() {
		return storyId;
	}
	public void setStoryId(String storyId) {
		this.storyId = storyId;
	}
	public String getImg() {
		return img;
	}
	public void setImg(String img) {
		this.img = img;
	}
	public Date getShareTime() {
		return shareTime;
	}
	public void setShareTime(Date shareTime) {
		this.shareTime = shareTime;
	}
	@OneToMany(cascade = { CascadeType.REFRESH}, fetch=FetchType.EAGER)
	@JoinColumn(name="storyCardId",updatable =false,insertable =false)
	@Fetch(FetchMode.SUBSELECT)
	public List<StoryCardPraise> getPraiseList() {
		return praiseList;
	}
	public void setPraiseList(List<StoryCardPraise> praiseList) {
		this.praiseList = praiseList;
	}
	
	
}
