1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.mobility.writer.entity;
17
18 import java.util.Date;
19
20 import javax.persistence.*;
21
22
23
24
25
26
27 @NamedQueries({
28 @NamedQuery(
29 name = "Comment.getCommentsForArticle",
30 query = "SELECT c FROM Comment c WHERE article_id = :articleId ORDER BY c.timestamp DESC"),
31 @NamedQuery(
32 name = "Comment.deleteComment",
33 query = "DELETE Comment WHERE id = :commentId"
34 )
35 })
36 @Entity
37 @Table(name="WRITER_COMMENT")
38 public class Comment {
39
40
41 @Column(name="USER_DISPLAY_NAME", nullable=false, length=128)
42 private String userDisplayName;
43
44
45 @Id
46 @GeneratedValue(strategy = GenerationType.TABLE)
47 @Column(name="ID")
48 private Long id;
49
50
51 @Column(name="ARTICLE_ID", nullable=false)
52 private long articleId;
53
54
55 @Column(name="TIMESTAMP", nullable=false)
56 private Date timestamp;
57
58
59 @Column(name="TITLE", nullable=false, length=64)
60 private String title;
61
62
63 @Column(name="TEXT", nullable=false, length=250)
64 private String text;
65
66
67 @Version
68 @Column(name="VER_NBR")
69 protected long versionNumber;
70
71
72
73
74 public String getUserDisplayName() {
75 return userDisplayName;
76 }
77
78
79
80
81 public void setUserDisplayName(String userDisplayName) {
82 this.userDisplayName = userDisplayName;
83 }
84
85
86
87
88 public Long getId() {
89 return id;
90 }
91
92
93
94
95 public void setId(Long id) {
96 this.id = id;
97 }
98
99
100
101
102 public long getArticleId() {
103 return articleId;
104 }
105
106
107
108
109 public void setArticleId(long articleId) {
110 this.articleId = articleId;
111 }
112
113
114
115
116 public Date getTimestamp() {
117 return timestamp;
118 }
119
120
121
122
123 public void setTimestamp(Date timestamp) {
124 this.timestamp = timestamp;
125 }
126
127
128
129
130 public String getTitle() {
131 return title;
132 }
133
134
135
136
137 public void setTitle(String title) {
138 this.title = title;
139 }
140
141
142
143
144 public String getText() {
145 return text;
146 }
147
148
149
150
151 public void setText(String text) {
152 this.text = text;
153 }
154
155
156
157
158
159 public long getVersionNumber() {
160 return versionNumber;
161 }
162
163
164
165
166
167
168 public void setVersionNumber(long versionNumber) {
169 this.versionNumber = versionNumber;
170 }
171
172 }