diff options
Diffstat (limited to 'src/main/java/io/trygvis/model')
-rwxr-xr-x | src/main/java/io/trygvis/model/Article.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/main/java/io/trygvis/model/Article.java b/src/main/java/io/trygvis/model/Article.java new file mode 100755 index 0000000..6383e50 --- /dev/null +++ b/src/main/java/io/trygvis/model/Article.java @@ -0,0 +1,57 @@ +package io.trygvis.model;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+@Entity
+public class Article {
+ @Id
+ @SequenceGenerator(name="id_seq", sequenceName="id_seq")
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "id_seq")
+ private Integer id;
+ private Date created;
+ private Date updated;
+ private String title;
+ private String body;
+
+ @SuppressWarnings("UnusedDeclaration")
+ private Article() {
+ }
+
+ public Article(Date created, Date updated, String title, String body) {
+ this.created = created;
+ this.updated = updated;
+ this.title = title;
+ this.body = body;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public Date getUpdated() {
+ return updated;
+ }
+
+ public void setUpdated(Date updated) {
+ this.updated = updated;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getBody() {
+ return body;
+ }
+}
|