package com.tencent.model;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name="blog")
public class Blog extends BaseBean {
private static final long serialVersionUID = 8055366380034692286L;
private String title;
private String content;
private Timestamp publishDate = null;
private int count; //times of click on
private User author = null;
public Blog() {
super();
}
public Blog(String title, String content, int count) {
super();
this.title = title;
this.content = content;
this.count = count;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Basic(fetch = FetchType.LAZY)
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Column(name="publish_date")
public Timestamp getPublishDate() {
return publishDate;
}
public void setPublishDate(Timestamp publishDate) {
this.publishDate = publishDate;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "id_author")
public User getAuthor() {
return author;
}
public void setAuthor(User author) {
this.author = author;
}
}