KickJava   Java API By Example, From Geeks To Geeks.

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


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.List JavaDoc;
16 import java.util.Set JavaDoc;
17
18 import org.jboss.portlet.forums.model.Category;
19 import org.jboss.portlet.forums.model.Forum;
20 import org.jboss.portlet.forums.model.Post;
21
22 /**
23  * Category of forums.
24  *
25  * @hibernate.class table="jbp_forums_forums"
26  *
27  * @author <a HREF="mailto:julien@jboss.org">Julien Viet </a>
28  * @author <a HREF="mailto:theute@jboss.org">Thomas Heute </a>
29  * @version $Revision: 1.6 $
30  */

31 public class ForumImpl
32    implements Serializable JavaDoc,
33               Forum
34 {
35    /**
36     * Creates a new {@link ForumImpl} object.
37     */

38    public ForumImpl()
39    {
40    }
41
42    private Category category;
43    private String JavaDoc description;
44    private Integer JavaDoc id;
45    private Post lastPost;
46    private String JavaDoc name;
47    private int order;
48    private int topicCount;
49    private int postCount;
50    private boolean pruneEnable;
51    private int pruneNext;
52    private int status;
53    private List JavaDoc topics;
54    private Collection JavaDoc watch;
55    private int type;
56    private List JavaDoc watches;
57
58    /**
59     * @hibernate.many-to-one
60     * column="jbp_category_id"
61     * class="org.jboss.portlet.forums.impl.CategoryImpl"
62     */

63    public Category getCategory()
64    {
65       return category;
66    }
67
68    /**
69     * DOCUMENT_ME
70     *
71     * @param category DOCUMENT_ME
72     */

73    public void setCategory(Category category)
74    {
75       this.category = category;
76    }
77
78    /**
79     * @hibernate.property
80     * column="jbp_description"
81     * unique="false"
82     * update="true"
83     */

84    public String JavaDoc getDescription()
85    {
86       return description;
87    }
88
89    /**
90     * DOCUMENT_ME
91     *
92     * @param description DOCUMENT_ME
93     */

94    public void setDescription(String JavaDoc description)
95    {
96       this.description = description;
97    }
98
99    /**
100     * @hibernate.id
101     * column="jbp_id"
102     * generator-class="native"
103     */

104    public Integer JavaDoc getID()
105    {
106       return id;
107    }
108
109    private void setID(Integer JavaDoc id)
110    {
111       this.id = id;
112    }
113
114    /**
115     * @hibernate.many-to-one
116     * column="jbp_last_post_id"
117     * class="org.jboss.portlet.forums.impl.PostImpl"
118     */

119    public Post getLastPost()
120    {
121       return lastPost;
122    }
123
124    /**
125     * DOCUMENT_ME
126     *
127     * @param lastPost DOCUMENT_ME
128     */

129    public void setLastPost(Post lastPost)
130    {
131       this.lastPost = lastPost;
132    }
133
134    /**
135     * @hibernate.property
136     * column="jbp_name"
137     * unique="false"
138     * update="true"
139     */

140    public String JavaDoc getName()
141    {
142       return name;
143    }
144
145    /**
146     * DOCUMENT_ME
147     *
148     * @param name DOCUMENT_ME
149     */

150    public void setName(String JavaDoc name)
151    {
152       this.name = name;
153    }
154
155    /**
156     * @hibernate.property
157     * column="jbp_order"
158     * unique="false"
159     * update="true"
160     */

161    public int getOrder()
162    {
163       return order;
164    }
165
166    /**
167     * DOCUMENT_ME
168     *
169     * @param order DOCUMENT_ME
170     */

171    public void setOrder(int order)
172    {
173       this.order = order;
174    }
175
176    /**
177     * @hibernate.property
178     * column="jbp_topic_count"
179     * unique="false"
180     * update="true"
181     */

182    public int getTopicCount()
183    {
184       return topicCount;
185    }
186
187    /**
188     * DOCUMENT_ME
189     *
190     * @param size DOCUMENT_ME
191     */

192    public void setTopicCount(int size)
193    {
194       this.topicCount = size;
195    }
196
197    /**
198     * DOCUMENT_ME
199     */

200    public void addTopicSize()
201    {
202       setTopicCount(topicCount + 1);
203    }
204
205    /**
206     * @hibernate.property
207     * column="jbp_post_count"
208     * unique="false"
209     * update="true"
210     */

211    public int getPostCount()
212    {
213       return postCount;
214    }
215
216    /**
217     * DOCUMENT_ME
218     *
219     * @param size DOCUMENT_ME
220     */

221    public void setPostCount(int size)
222    {
223       this.postCount = size;
224    }
225
226    /**
227     * DOCUMENT_ME
228     */

229    public void addPostSize()
230    {
231       setPostCount(postCount + 1);
232    }
233
234    /**
235     * @hibernate.property
236     * column="jbp_prune_enable"
237     * unique="false"
238     * update="true"
239     */

240    public boolean getPruneEnable()
241    {
242       return pruneEnable;
243    }
244
245    /**
246     * DOCUMENT_ME
247     *
248     * @param enable DOCUMENT_ME
249     */

250    public void setPruneEnable(boolean enable)
251    {
252       this.pruneEnable = enable;
253    }
254
255    /**
256     * @hibernate.property
257     * column="jbp_prune_next"
258     * unique="false"
259     * update="true"
260     */

261    public int getPruneNext()
262    {
263       return pruneNext;
264    }
265
266    /**
267     * DOCUMENT_ME
268     *
269     * @param next DOCUMENT_ME
270     */

271    public void setPruneNext(int next)
272    {
273       this.pruneNext = next;
274    }
275
276    /**
277     * @hibernate.property
278     * column="jbp_status"
279     * unique="false"
280     * update="true"
281     */

282    public int getStatus()
283    {
284       return status;
285    }
286
287    /**
288     * DOCUMENT_ME
289     *
290     * @param status DOCUMENT_ME
291     */

292    public void setStatus(int status)
293    {
294       this.status = status;
295    }
296
297    /**
298     * @hibernate.bag
299     * lazy="true"
300     * inverse="true"
301     * cascade="all"
302     * @hibernate.collection-key
303     * column="jbp_forum_id"
304     * @hibernate.collection-one-to-many
305     * class="org.jboss.portlet.forums.impl.TopicImpl"
306     */

307    public List JavaDoc getTopics()
308    {
309       return topics;
310    }
311
312    /**
313     * DOCUMENT_ME
314     *
315     * @param value DOCUMENT_ME
316     */

317    public void setTopics(List JavaDoc value)
318    {
319       topics = value;
320    }
321
322    /**
323     * @hibernate.bag
324     * lazy="true"
325     * inverse="true"
326     * cascade="all"
327     * @hibernate.collection-key
328     * column="jbp_forum_id"
329     * @hibernate.collection-one-to-many
330     * class="org.jboss.portlet.forums.impl.ForumWatchImpl"
331     */

332    public Collection JavaDoc getForumWatch()
333    {
334       return watch;
335    }
336
337    /**
338     * DOCUMENT_ME
339     *
340     * @param watch DOCUMENT_ME
341     */

342    public void setForumWatch(Collection JavaDoc watch)
343    {
344       this.watch = watch;
345    }
346
347    /**
348     * @hibernate.property
349     * column="jbp_type"
350     * update="true"
351     */

352    public int getType()
353    {
354       return type;
355    }
356
357    /**
358     * DOCUMENT_ME
359     *
360     * @param type DOCUMENT_ME
361     */

362    public void setType(int type)
363    {
364       this.type = type;
365    }
366
367    /**
368     * @hibernate.bag
369     * lazy="true"
370     * inverse="true"
371     * cascade="all"
372     * @hibernate.collection-key
373     * column="jbp_forum_id"
374     * @hibernate.collection-one-to-many
375     * class="org.jboss.portlet.forums.impl.ForumWatchImpl"
376     */

377    public List JavaDoc getWatches()
378    {
379       return watches;
380    }
381    
382    public void setWatches(List JavaDoc watches)
383    {
384       this.watches = watches;
385    }
386 }
Popular Tags