Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.szczerbakowski.magenta.model.entities;
- import java.io.Serializable;
- import java.util.Date;
- import java.util.List;
- import javax.persistence.Column;
- 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.OneToMany;
- import javax.persistence.SequenceGenerator;
- import javax.persistence.Table;
- import javax.persistence.Transient;
- import javax.validation.constraints.NotNull;
- import javax.validation.constraints.Size;
- import javax.persistence.Entity;
- @Entity
- @Table(name = "ARTICLE")
- @SequenceGenerator(sequenceName = "ArticleSeq", name = "ArticleSeqGen")
- public class Article implements Serializable {
- @Id
- @GeneratedValue(generator = "ArticleSeqGen", strategy = GenerationType.SEQUENCE)
- private long id;
- // private String author;
- @Column(name = "title")
- private String title;
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "CategoryID", nullable = false)
- private Category category;
- @Column(name = "content")
- private String content;
- @Column(name = "publicationDate", nullable = false)
- private Date publicationDate;
- public long getId() {
- return id;
- }
- public void setId(long id) {
- this.id = id;
- }
- public String getTitle() {
- return title;
- }
- public void setTitle(String title) {
- this.title = title;
- }
- public Category getCategory() {
- return category;
- }
- public void setCategory(Category category) {
- this.category = category;
- }
- public String getContent() {
- return content;
- }
- public void setContent(String content) {
- this.content = content;
- }
- public Date getPublicationDate() {
- return publicationDate;
- }
- public void setPublicationDate(Date publicationDate) {
- this.publicationDate = publicationDate;
- }
- }
Add Comment
Please, Sign In to add comment