KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mvnforum > phpbb2mvnforum > db > PhpbbTopics


1 package org.mvnforum.phpbb2mvnforum.db;
2
3 //import java.sql.*; // @todo: uncomment as needed
4
import java.util.Collection JavaDoc;//for xml support
5
import java.util.Iterator JavaDoc;//for xml support
6

7 /*
8  * Included columns: topic_id, forum_id, topic_title, topic_poster, topic_time,
9  * topic_views, topic_replies, topic_status, topic_vote, topic_type,
10  * topic_first_post_id, topic_last_post_id, topic_moved_id
11  * Excluded columns:
12  */

13 public class PhpbbTopics {
14     private int topic_id;
15     private int forum_id;
16     private String JavaDoc topic_title;
17     private int topic_poster;
18     private int topic_time;
19     private int topic_views;
20     private int topic_replies;
21     private int topic_status;
22     private int topic_vote;
23     private int topic_type;
24     private int topic_first_post_id;
25     private int topic_last_post_id;
26     private int topic_moved_id;
27
28     public int gettopic_id() {
29         return topic_id;
30     }
31     public void settopic_id(int topic_id) {
32         this.topic_id = topic_id;
33     }
34
35     public int getforum_id() {
36         return forum_id;
37     }
38     public void setforum_id(int forum_id) {
39         this.forum_id = forum_id;
40     }
41
42     public String JavaDoc gettopic_title() {
43         return topic_title;
44     }
45     public void settopic_title(String JavaDoc topic_title) {
46         this.topic_title = topic_title;
47     }
48
49     public int gettopic_poster() {
50         return topic_poster;
51     }
52     public void settopic_poster(int topic_poster) {
53         this.topic_poster = topic_poster;
54     }
55
56     public int gettopic_time() {
57         return topic_time;
58     }
59     public void settopic_time(int topic_time) {
60         this.topic_time = topic_time;
61     }
62
63     public int gettopic_views() {
64         return topic_views;
65     }
66     public void settopic_views(int topic_views) {
67         this.topic_views = topic_views;
68     }
69
70     public int gettopic_replies() {
71         return topic_replies;
72     }
73     public void settopic_replies(int topic_replies) {
74         this.topic_replies = topic_replies;
75     }
76
77     public int gettopic_status() {
78         return topic_status;
79     }
80     public void settopic_status(int topic_status) {
81         this.topic_status = topic_status;
82     }
83
84     public int gettopic_vote() {
85         return topic_vote;
86     }
87     public void settopic_vote(int topic_vote) {
88         this.topic_vote = topic_vote;
89     }
90
91     public int gettopic_type() {
92         return topic_type;
93     }
94     public void settopic_type(int topic_type) {
95         this.topic_type = topic_type;
96     }
97
98     public int gettopic_first_post_id() {
99         return topic_first_post_id;
100     }
101     public void settopic_first_post_id(int topic_first_post_id) {
102         this.topic_first_post_id = topic_first_post_id;
103     }
104
105     public int gettopic_last_post_id() {
106         return topic_last_post_id;
107     }
108     public void settopic_last_post_id(int topic_last_post_id) {
109         this.topic_last_post_id = topic_last_post_id;
110     }
111
112     public int gettopic_moved_id() {
113         return topic_moved_id;
114     }
115     public void settopic_moved_id(int topic_moved_id) {
116         this.topic_moved_id = topic_moved_id;
117     }
118
119     public String JavaDoc getXML() {
120         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
121         xml.append("<phpbb_topicsSection>\n");
122         xml.append(" <Rows>\n");
123         xml.append(" <Row>\n");
124         xml.append(" <Column>\n");
125         xml.append(" <Name>topic_id</Name>\n");
126         xml.append(" <Value>").append(String.valueOf(topic_id)).append("</Value>\n");
127         xml.append(" </Column>\n");
128         xml.append(" <Column>\n");
129         xml.append(" <Name>forum_id</Name>\n");
130         xml.append(" <Value>").append(String.valueOf(forum_id)).append("</Value>\n");
131         xml.append(" </Column>\n");
132         xml.append(" <Column>\n");
133         xml.append(" <Name>topic_title</Name>\n");
134         xml.append(" <Value>").append(String.valueOf(topic_title)).append("</Value>\n");
135         xml.append(" </Column>\n");
136         xml.append(" <Column>\n");
137         xml.append(" <Name>topic_poster</Name>\n");
138         xml.append(" <Value>").append(String.valueOf(topic_poster)).append("</Value>\n");
139         xml.append(" </Column>\n");
140         xml.append(" <Column>\n");
141         xml.append(" <Name>topic_time</Name>\n");
142         xml.append(" <Value>").append(String.valueOf(topic_time)).append("</Value>\n");
143         xml.append(" </Column>\n");
144         xml.append(" <Column>\n");
145         xml.append(" <Name>topic_views</Name>\n");
146         xml.append(" <Value>").append(String.valueOf(topic_views)).append("</Value>\n");
147         xml.append(" </Column>\n");
148         xml.append(" <Column>\n");
149         xml.append(" <Name>topic_replies</Name>\n");
150         xml.append(" <Value>").append(String.valueOf(topic_replies)).append("</Value>\n");
151         xml.append(" </Column>\n");
152         xml.append(" <Column>\n");
153         xml.append(" <Name>topic_status</Name>\n");
154         xml.append(" <Value>").append(String.valueOf(topic_status)).append("</Value>\n");
155         xml.append(" </Column>\n");
156         xml.append(" <Column>\n");
157         xml.append(" <Name>topic_vote</Name>\n");
158         xml.append(" <Value>").append(String.valueOf(topic_vote)).append("</Value>\n");
159         xml.append(" </Column>\n");
160         xml.append(" <Column>\n");
161         xml.append(" <Name>topic_type</Name>\n");
162         xml.append(" <Value>").append(String.valueOf(topic_type)).append("</Value>\n");
163         xml.append(" </Column>\n");
164         xml.append(" <Column>\n");
165         xml.append(" <Name>topic_first_post_id</Name>\n");
166         xml.append(" <Value>").append(String.valueOf(topic_first_post_id)).append("</Value>\n");
167         xml.append(" </Column>\n");
168         xml.append(" <Column>\n");
169         xml.append(" <Name>topic_last_post_id</Name>\n");
170         xml.append(" <Value>").append(String.valueOf(topic_last_post_id)).append("</Value>\n");
171         xml.append(" </Column>\n");
172         xml.append(" <Column>\n");
173         xml.append(" <Name>topic_moved_id</Name>\n");
174         xml.append(" <Value>").append(String.valueOf(topic_moved_id)).append("</Value>\n");
175         xml.append(" </Column>\n");
176         xml.append(" </Row>\n");
177         xml.append(" </Rows>\n");
178         xml.append("</phpbb_topicsSection>\n");
179         return xml.toString();
180     }
181
182     public static String JavaDoc getXML(Collection JavaDoc objphpbb_topicsBeans) {
183         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
184         Iterator JavaDoc iterator = objphpbb_topicsBeans.iterator();
185         xml.append("<phpbb_topicsSection>\n");
186         xml.append(" <Rows>\n");
187         while (iterator.hasNext()) {
188             PhpbbTopics objphpbb_topicsBean = (PhpbbTopics)iterator.next();
189             xml.append(" <Row>\n");
190             xml.append(" <Column>\n");
191             xml.append(" <Name>topic_id</Name>\n");
192             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_id)).append("</Value>\n");
193             xml.append(" </Column>\n");
194             xml.append(" <Column>\n");
195             xml.append(" <Name>forum_id</Name>\n");
196             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.forum_id)).append("</Value>\n");
197             xml.append(" </Column>\n");
198             xml.append(" <Column>\n");
199             xml.append(" <Name>topic_title</Name>\n");
200             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_title)).append("</Value>\n");
201             xml.append(" </Column>\n");
202             xml.append(" <Column>\n");
203             xml.append(" <Name>topic_poster</Name>\n");
204             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_poster)).append("</Value>\n");
205             xml.append(" </Column>\n");
206             xml.append(" <Column>\n");
207             xml.append(" <Name>topic_time</Name>\n");
208             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_time)).append("</Value>\n");
209             xml.append(" </Column>\n");
210             xml.append(" <Column>\n");
211             xml.append(" <Name>topic_views</Name>\n");
212             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_views)).append("</Value>\n");
213             xml.append(" </Column>\n");
214             xml.append(" <Column>\n");
215             xml.append(" <Name>topic_replies</Name>\n");
216             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_replies)).append("</Value>\n");
217             xml.append(" </Column>\n");
218             xml.append(" <Column>\n");
219             xml.append(" <Name>topic_status</Name>\n");
220             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_status)).append("</Value>\n");
221             xml.append(" </Column>\n");
222             xml.append(" <Column>\n");
223             xml.append(" <Name>topic_vote</Name>\n");
224             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_vote)).append("</Value>\n");
225             xml.append(" </Column>\n");
226             xml.append(" <Column>\n");
227             xml.append(" <Name>topic_type</Name>\n");
228             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_type)).append("</Value>\n");
229             xml.append(" </Column>\n");
230             xml.append(" <Column>\n");
231             xml.append(" <Name>topic_first_post_id</Name>\n");
232             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_first_post_id)).append("</Value>\n");
233             xml.append(" </Column>\n");
234             xml.append(" <Column>\n");
235             xml.append(" <Name>topic_last_post_id</Name>\n");
236             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_last_post_id)).append("</Value>\n");
237             xml.append(" </Column>\n");
238             xml.append(" <Column>\n");
239             xml.append(" <Name>topic_moved_id</Name>\n");
240             xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_moved_id)).append("</Value>\n");
241             xml.append(" </Column>\n");
242             xml.append(" </Row>\n");
243         }//while
244
xml.append(" </Rows>\n");
245         xml.append("</phpbb_topicsSection>\n");
246         return xml.toString();
247     }
248 } //end of class phpbb_topicsBean
249
Popular Tags