package br.com.caelum.guj.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
@Entity
@Table(name = "posts")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Post {
@Id
@GeneratedValue
private Long id;
private String title;
private String author;
private String link;
private String summary;
@Column(name = "created_at")
private Date date;
@ManyToOne
@JoinColumn(name = "blog_id")
private Blog blog;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return this.author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getLink() {
return this.link;
}
public void setLink(String link) {
this.link = link;
}
public String getSummary() {
return this.summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public Date getDate() {
return this.date;
}
public void setDate(Date date) {
this.date = date;
}
public Blog getBlog() {
return this.blog;
}
public void setBlog(Blog blog) {
this.blog = blog;
}
}