KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mvnforum > db > FavoriteThreadBean


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/FavoriteThreadBean.java,v 1.6 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.6 $
5  * $Date: 2006/04/14 17:05:26 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  * @author: Mai Nguyen
40  */

41 package com.mvnforum.db;
42
43 import java.sql.Timestamp JavaDoc;
44 import java.util.Collection JavaDoc;
45 import java.util.Iterator JavaDoc;
46
47 /*
48  * Included columns: MemberID, ThreadID, ForumID, FavoriteCreationDate, FavoriteType,
49  * FavoriteOption, FavoriteStatus
50  * Excluded columns:
51  */

52 public class FavoriteThreadBean {
53     private int memberID;
54     private int threadID;
55     private int forumID;
56     private Timestamp JavaDoc favoriteCreationDate;
57     private int favoriteType;
58     private int favoriteOption;
59     private int favoriteStatus;
60
61     public int getMemberID() {
62         return memberID;
63     }
64     public void setMemberID(int memberID) {
65         this.memberID = memberID;
66     }
67
68     public int getThreadID() {
69         return threadID;
70     }
71     public void setThreadID(int threadID) {
72         this.threadID = threadID;
73     }
74
75     public int getForumID() {
76         return forumID;
77     }
78     public void setForumID(int forumID) {
79         this.forumID = forumID;
80     }
81
82     public Timestamp JavaDoc getFavoriteCreationDate() {
83         return favoriteCreationDate;
84     }
85     public void setFavoriteCreationDate(Timestamp JavaDoc favoriteCreationDate) {
86         this.favoriteCreationDate = favoriteCreationDate;
87     }
88
89     public int getFavoriteType() {
90         return favoriteType;
91     }
92     public void setFavoriteType(int favoriteType) {
93         this.favoriteType = favoriteType;
94     }
95
96     public int getFavoriteOption() {
97         return favoriteOption;
98     }
99     public void setFavoriteOption(int favoriteOption) {
100         this.favoriteOption = favoriteOption;
101     }
102
103     public int getFavoriteStatus() {
104         return favoriteStatus;
105     }
106     public void setFavoriteStatus(int favoriteStatus) {
107         this.favoriteStatus = favoriteStatus;
108     }
109
110     public String JavaDoc getXML() {
111         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
112         xml.append("<FavoriteThreadSection>\n");
113         xml.append(" <Rows>\n");
114         xml.append(" <Row>\n");
115         xml.append(" <Column>\n");
116         xml.append(" <Name>MemberID</Name>\n");
117         xml.append(" <Value>").append(String.valueOf(memberID)).append("</Value>\n");
118         xml.append(" </Column>\n");
119         xml.append(" <Column>\n");
120         xml.append(" <Name>ThreadID</Name>\n");
121         xml.append(" <Value>").append(String.valueOf(threadID)).append("</Value>\n");
122         xml.append(" </Column>\n");
123         xml.append(" <Column>\n");
124         xml.append(" <Name>ForumID</Name>\n");
125         xml.append(" <Value>").append(String.valueOf(forumID)).append("</Value>\n");
126         xml.append(" </Column>\n");
127         xml.append(" <Column>\n");
128         xml.append(" <Name>FavoriteCreationDate</Name>\n");
129         xml.append(" <Value>").append(String.valueOf(favoriteCreationDate)).append("</Value>\n");
130         xml.append(" </Column>\n");
131         xml.append(" <Column>\n");
132         xml.append(" <Name>FavoriteType</Name>\n");
133         xml.append(" <Value>").append(String.valueOf(favoriteType)).append("</Value>\n");
134         xml.append(" </Column>\n");
135         xml.append(" <Column>\n");
136         xml.append(" <Name>FavoriteOption</Name>\n");
137         xml.append(" <Value>").append(String.valueOf(favoriteOption)).append("</Value>\n");
138         xml.append(" </Column>\n");
139         xml.append(" <Column>\n");
140         xml.append(" <Name>FavoriteStatus</Name>\n");
141         xml.append(" <Value>").append(String.valueOf(favoriteStatus)).append("</Value>\n");
142         xml.append(" </Column>\n");
143         xml.append(" </Row>\n");
144         xml.append(" </Rows>\n");
145         xml.append("</FavoriteThreadSection>\n");
146         return xml.toString();
147     }
148
149     public static String JavaDoc getXML(Collection JavaDoc objFavoriteThreadBeans) {
150         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
151         Iterator JavaDoc iterator = objFavoriteThreadBeans.iterator();
152         xml.append("<FavoriteThreadSection>\n");
153         xml.append(" <Rows>\n");
154         while (iterator.hasNext()) {
155             FavoriteThreadBean objFavoriteThreadBean = (FavoriteThreadBean)iterator.next();
156             xml.append(" <Row>\n");
157             xml.append(" <Column>\n");
158             xml.append(" <Name>MemberID</Name>\n");
159             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.memberID)).append("</Value>\n");
160             xml.append(" </Column>\n");
161             xml.append(" <Column>\n");
162             xml.append(" <Name>ThreadID</Name>\n");
163             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.threadID)).append("</Value>\n");
164             xml.append(" </Column>\n");
165             xml.append(" <Column>\n");
166             xml.append(" <Name>ForumID</Name>\n");
167             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.forumID)).append("</Value>\n");
168             xml.append(" </Column>\n");
169             xml.append(" <Column>\n");
170             xml.append(" <Name>FavoriteCreationDate</Name>\n");
171             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteCreationDate)).append("</Value>\n");
172             xml.append(" </Column>\n");
173             xml.append(" <Column>\n");
174             xml.append(" <Name>FavoriteType</Name>\n");
175             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteType)).append("</Value>\n");
176             xml.append(" </Column>\n");
177             xml.append(" <Column>\n");
178             xml.append(" <Name>FavoriteOption</Name>\n");
179             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteOption)).append("</Value>\n");
180             xml.append(" </Column>\n");
181             xml.append(" <Column>\n");
182             xml.append(" <Name>FavoriteStatus</Name>\n");
183             xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteStatus)).append("</Value>\n");
184             xml.append(" </Column>\n");
185             xml.append(" </Row>\n");
186         }//while
187
xml.append(" </Rows>\n");
188         xml.append("</FavoriteThreadSection>\n");
189         return xml.toString();
190     }
191 } //end of class FavoriteThreadBean
192
Popular Tags