KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portlet > forums > impl > TopicImpl


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Forums JBoss Portlet *
6  * *
7  * Distributable under LGPL license. *
8  * See terms of license at gnu.org. *
9  * *
10  *****************************************/

11 package org.jboss.portlet.forums.impl;
12
13 import java.io.Serializable JavaDoc;
14 import java.util.Collection JavaDoc;
15 import java.util.Date JavaDoc;
16 import java.util.List JavaDoc;
17
18 import org.jboss.portlet.forums.model.Forum;
19 import org.jboss.portlet.forums.model.Post;
20 import org.jboss.portlet.forums.model.Poster;
21 import org.jboss.portlet.forums.model.Topic;
22
23 /**
24  * @hibernate.class table="jbp_forums_topics"
25  *
26  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
27  * @author <a HREF="mailto:theute@jboss.org">Thomas Heute</a>
28  * @version $Revision: 1.6 $
29  */

30 public class TopicImpl
31    implements Serializable JavaDoc,
32               Topic
33 {
34    private Integer JavaDoc id;
35    private Collection JavaDoc posts;
36    private Forum forum;
37    private int viewCount;
38    private Date JavaDoc date;
39    private int replies;
40    private Post firstPost;
41    private Post lastPost;
42    private Date JavaDoc lastPostDate;
43    private Date JavaDoc editDate;
44    private Poster poster;
45    private int type;
46    private int status;
47    private Topic target;
48    private String JavaDoc subject;
49    private List JavaDoc watches;
50
51    /**
52     * Creates a new {@link TopicImpl} object.
53     */

54    public TopicImpl()
55    {
56    }
57
58    /**
59     * @hibernate.id
60     * column="jbp_id"
61     * generator-class="native"
62     */

63    public Integer JavaDoc getID()
64    {
65       return id;
66    }
67
68    /**
69     * DOCUMENT_ME
70     *
71     * @param id DOCUMENT_ME
72     */

73    public void setID(Integer JavaDoc id)
74    {
75       this.id = id;
76    }
77
78    /**
79     * @hibernate.collection-many-to-one
80     * class="org.jboss.portlet.forums.impl.ForumImpl"
81     */

82    public Collection JavaDoc getPosts()
83    {
84       return posts;
85    }
86
87    /**
88     * DOCUMENT_ME
89     *
90     * @param value DOCUMENT_ME
91     */

92    public void setPosts(java.util.Collection JavaDoc value)
93    {
94       posts = value;
95    }
96
97    /**
98     * @hibernate.many-to-one
99     * column="jbp_forum_id"
100     * class="org.jboss.portlet.forums.impl.ForumImpl"
101     */

102    public Forum getForum()
103    {
104       return forum;
105    }
106
107    /**
108     * DOCUMENT_ME
109     *
110     * @param forum DOCUMENT_ME
111     */

112    public void setForum(Forum forum)
113    {
114       this.forum = forum;
115    }
116
117    /**
118     * @hibernate.property
119     * column="jbp_view_count"
120     * unique="false"
121     * update="true"
122     */

123    public int getViewCount()
124    {
125       return viewCount;
126    }
127
128    /**
129     * DOCUMENT_ME
130     *
131     * @param viewCount DOCUMENT_ME
132     */

133    public void setViewCount(int viewCount)
134    {
135       this.viewCount = viewCount;
136    }
137
138    /**
139     * @hibernate.property
140     * column="jbp_replies"
141     * unique="false"
142     * update="true"
143     */

144    public int getReplies()
145    {
146       return replies;
147    }
148
149    /**
150     * DOCUMENT_ME
151     *
152     * @param replies DOCUMENT_ME
153     */

154    public void setReplies(int replies)
155    {
156       this.replies = replies;
157    }
158
159    /**
160     * @hibernate.many-to-one
161     * column="jbp_first_post_id"
162     * class="org.jboss.portlet.forums.impl.PostImpl"
163     */

164    public Post getFirstPost()
165    {
166       return firstPost;
167    }
168
169    /**
170     * DOCUMENT_ME
171     *
172     * @param post DOCUMENT_ME
173     */

174    public void setFirstPost(Post post)
175    {
176       this.firstPost = post;
177    }
178
179    /**
180     * @hibernate.many-to-one
181     * column="jbp_last_post_id"
182     * class="org.jboss.portlet.forums.impl.PostImpl"
183     */

184    public Post getLastPost()
185    {
186       return lastPost;
187    }
188
189    /**
190     * DOCUMENT_ME
191     *
192     * @param post DOCUMENT_ME
193     */

194    public void setLastPost(Post post)
195    {
196       forum.setLastPost(post);
197       this.lastPost = post;
198    }
199
200    /**
201     * @hibernate.property
202     * column="jbp_last_post_date"
203     * unique="false"
204     * update="true"
205     */

206    public Date JavaDoc getLastPostDate()
207    {
208       return lastPostDate;
209    }
210
211    /**
212     * DOCUMENT_ME
213     *
214     * @param lastPostDate DOCUMENT_ME
215     */

216    public void setLastPostDate(Date JavaDoc lastPostDate)
217    {
218       this.lastPostDate = lastPostDate;
219    }
220
221    /**
222     * @hibernate.many-to-one
223     * column="jbp_poster"
224     * class="org.jboss.portlet.forums.impl.PosterImpl"
225     */

226    public Poster getPoster()
227    {
228       return poster;
229    }
230
231    /**
232     * DOCUMENT_ME
233     *
234     * @param poster DOCUMENT_ME
235     */

236    public void setPoster(Poster poster)
237    {
238       this.poster = poster;
239    }
240
241    /**
242     * @hibernate.property
243     * column="jbp_type"
244     * unique="false"
245     * update="true"
246     */

247    public int getType()
248    {
249       return type;
250    }
251
252    /**
253     * DOCUMENT_ME
254     *
255     * @param type DOCUMENT_ME
256     */

257    public void setType(int type)
258    {
259       this.type = type;
260    }
261
262    /**
263     * @hibernate.property
264     * column="jbp_status"
265     * unique="false"
266     * update="true"
267     */

268    public int getStatus()
269    {
270       return status;
271    }
272
273    /**
274     * DOCUMENT_ME
275     *
276     * @param status DOCUMENT_ME
277     */

278    public void setStatus(int status)
279    {
280       this.status = status;
281    }
282
283    /**
284     * @hibernate.one-to-one
285     * column="jbp_target"
286     * class="org.jboss.portlet.forums.impl.TopicImpl"
287     */

288    public Topic getTarget()
289    {
290       return target;
291    }
292
293    /**
294     * DOCUMENT_ME
295     *
296     * @param target DOCUMENT_ME
297     */

298    public void setTarget(Topic target)
299    {
300       this.target = target;
301    }
302
303    /**
304     * @hibernate.property
305     * column="jbp_subject"
306     * unique="false"
307     * update="true"
308     */

309    public String JavaDoc getSubject()
310    {
311       return subject;
312    }
313
314    /**
315     * DOCUMENT_ME
316     *
317     * @param subject DOCUMENT_ME
318     */

319    public void setSubject(String JavaDoc subject)
320    {
321       this.subject = subject;
322    }
323    
324    /**
325     * @hibernate.bag
326     * lazy="true"
327     * inverse="true"
328     * cascade="all"
329     * @hibernate.collection-key
330     * column="jbp_topic_id"
331     * @hibernate.collection-one-to-many
332     * class="org.jboss.portlet.forums.impl.TopicWatchImpl"
333     */

334    public List JavaDoc getWatches()
335    {
336       return watches;
337    }
338    
339    public void setWatches(List JavaDoc watches)
340    {
341       this.watches = watches;
342    }
343 }
Popular Tags