package org.cs.mgr.admin.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;


/**
 * TbNews entity. @author MyEclipse Persistence Tools
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name="tb_news")
public class TbNews  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = -5604638990939519898L;
	private Integer id;
     private String classCode;//分类code  "1"目前分类全是1
     private String newsShow;//是否显示，0为否，1为是，默认为1
     private Integer newsSort;
     private String newsTitle;//标题
     private String newsContent;//新闻内容
     private Date createTime;
     private String sourceUrl;//来源url
     private String sourceWebsite;//来源网站
     private String newsImage;
     private String newsAbstract;//摘要
     private String keywords;//关键字
     /**是否公开*/
 	 private Boolean openFlag;//是否公开  "1"公开，
     

    // Constructors

    /** default constructor */
    public TbNews() {
    }

	/** minimal constructor */
    public TbNews(String classCode, String newsShow, Integer newsSort, String newsTitle, Date createTime) {
        this.classCode = classCode;
        this.newsShow = newsShow;
        this.newsSort = newsSort;
        this.newsTitle = newsTitle;
        this.createTime = createTime;
    }
    
    /** full constructor */
    public TbNews(String classCode, String newsShow, Integer newsSort, String newsTitle, String newsContent, Date createTime, String sourceUrl, String sourceWebsite, String keywords,Boolean openFlag) {
        this.classCode = classCode;
        this.newsShow = newsShow;
        this.newsSort = newsSort;
        this.newsTitle = newsTitle;
        this.newsContent = newsContent;
        this.createTime = createTime;
        this.sourceUrl = sourceUrl;
        this.sourceWebsite = sourceWebsite;
        this.keywords = keywords;
        this.openFlag=openFlag;
        
    }

   
    @Id
	@SequenceGenerator(name="TB_NEWS",sequenceName="NEWS_SEQ")
	@GeneratedValue(generator="TB_NEWS",strategy=GenerationType.SEQUENCE)
	@Column(name = "id", unique = true, nullable = false, precision = 11, scale = 0)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="class_code", nullable=false, length=20)

    public String getClassCode() {
        return this.classCode;
    }
    
    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }
    
    @Column(name="news_show", nullable=false, length=1)

    public String getNewsShow() {
        return this.newsShow;
    }
    
    public void setNewsShow(String newsShow) {
        this.newsShow = newsShow;
    }
    
    @Column(name="news_sort", nullable=false)

    public Integer getNewsSort() {
        return this.newsSort;
    }
    
    public void setNewsSort(Integer newsSort) {
        this.newsSort = newsSort;
    }
    
    @Column(name="news_title", nullable=false)

    public String getNewsTitle() {
        return this.newsTitle;
    }
    
    public void setNewsTitle(String newsTitle) {
        this.newsTitle = newsTitle;
    }
    
    @Column(name="news_content", length=65535)

    public String getNewsContent() {
        return this.newsContent;
    }
    
    public void setNewsContent(String newsContent) {
        this.newsContent = newsContent;
    }
    
    @Column(name = "create_time", columnDefinition="DATE" )
    public Date getCreateTime() {
        return this.createTime;
    }
    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    @Column(name="source_url")

    public String getSourceUrl() {
        return this.sourceUrl;
    }
    
    public void setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
    }
    
    @Column(name="source_website", length=50)

    public String getSourceWebsite() {
        return this.sourceWebsite;
    }
    
    public void setSourceWebsite(String sourceWebsite) {
        this.sourceWebsite = sourceWebsite;
    }

    @Column(name="news_image", length=200)
	public String getNewsImage() {
		return newsImage;
	}

	public void setNewsImage(String newsImage) {
		this.newsImage = newsImage;
	}

	@Column(name="news_abstract", length=200)
	public String getNewsAbstract() {
		return newsAbstract;
	}

	public void setNewsAbstract(String newsAbstract) {
		this.newsAbstract = newsAbstract;
	}
	
	@Column(name="keywords", length=200)
	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}
	
	@Column(name="open_flag", nullable = false, columnDefinition="number(1) default 1")
	public Boolean getOpenFlag() {
		return openFlag;
	}

	public void setOpenFlag(Boolean openFlag) {
		this.openFlag = openFlag;
	}
    



}