KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MemberTutorBean.java,v 1.4 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.4 $
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, MemberName, TutorID, TutorName, CreationDate,
49  * ExpireDate, RelationType, RelationOption, RelationStatus
50  * Excluded columns:
51  */

52 public class MemberTutorBean {
53     private int memberID;
54     private String JavaDoc memberName;
55     private int tutorID;
56     private String JavaDoc tutorName;
57     private Timestamp JavaDoc creationDate;
58     private Timestamp JavaDoc expireDate;
59     private int relationType;
60     private int relationOption;
61     private int relationStatus;
62
63     public int getMemberID() {
64         return memberID;
65     }
66     public void setMemberID(int memberID) {
67         this.memberID = memberID;
68     }
69
70     public String JavaDoc getMemberName() {
71         return memberName;
72     }
73     public void setMemberName(String JavaDoc memberName) {
74         this.memberName = memberName;
75     }
76
77     public int getTutorID() {
78         return tutorID;
79     }
80     public void setTutorID(int tutorID) {
81         this.tutorID = tutorID;
82     }
83
84     public String JavaDoc getTutorName() {
85         return tutorName;
86     }
87     public void setTutorName(String JavaDoc tutorName) {
88         this.tutorName = tutorName;
89     }
90
91     public Timestamp JavaDoc getCreationDate() {
92         return creationDate;
93     }
94     public void setCreationDate(Timestamp JavaDoc creationDate) {
95         this.creationDate = creationDate;
96     }
97
98     public Timestamp JavaDoc getExpireDate() {
99         return expireDate;
100     }
101     public void setExpireDate(Timestamp JavaDoc expireDate) {
102         this.expireDate = expireDate;
103     }
104
105     public int getRelationType() {
106         return relationType;
107     }
108     public void setRelationType(int relationType) {
109         this.relationType = relationType;
110     }
111
112     public int getRelationOption() {
113         return relationOption;
114     }
115     public void setRelationOption(int relationOption) {
116         this.relationOption = relationOption;
117     }
118
119     public int getRelationStatus() {
120         return relationStatus;
121     }
122     public void setRelationStatus(int relationStatus) {
123         this.relationStatus = relationStatus;
124     }
125
126     public String JavaDoc getXML() {
127         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
128         xml.append("<MemberTutorSection>\n");
129         xml.append(" <Rows>\n");
130         xml.append(" <Row>\n");
131         xml.append(" <Column>\n");
132         xml.append(" <Name>MemberID</Name>\n");
133         xml.append(" <Value>").append(String.valueOf(memberID)).append("</Value>\n");
134         xml.append(" </Column>\n");
135         xml.append(" <Column>\n");
136         xml.append(" <Name>MemberName</Name>\n");
137         xml.append(" <Value>").append(String.valueOf(memberName)).append("</Value>\n");
138         xml.append(" </Column>\n");
139         xml.append(" <Column>\n");
140         xml.append(" <Name>TutorID</Name>\n");
141         xml.append(" <Value>").append(String.valueOf(tutorID)).append("</Value>\n");
142         xml.append(" </Column>\n");
143         xml.append(" <Column>\n");
144         xml.append(" <Name>TutorName</Name>\n");
145         xml.append(" <Value>").append(String.valueOf(tutorName)).append("</Value>\n");
146         xml.append(" </Column>\n");
147         xml.append(" <Column>\n");
148         xml.append(" <Name>CreationDate</Name>\n");
149         xml.append(" <Value>").append(String.valueOf(creationDate)).append("</Value>\n");
150         xml.append(" </Column>\n");
151         xml.append(" <Column>\n");
152         xml.append(" <Name>ExpireDate</Name>\n");
153         xml.append(" <Value>").append(String.valueOf(expireDate)).append("</Value>\n");
154         xml.append(" </Column>\n");
155         xml.append(" <Column>\n");
156         xml.append(" <Name>RelationType</Name>\n");
157         xml.append(" <Value>").append(String.valueOf(relationType)).append("</Value>\n");
158         xml.append(" </Column>\n");
159         xml.append(" <Column>\n");
160         xml.append(" <Name>RelationOption</Name>\n");
161         xml.append(" <Value>").append(String.valueOf(relationOption)).append("</Value>\n");
162         xml.append(" </Column>\n");
163         xml.append(" <Column>\n");
164         xml.append(" <Name>RelationStatus</Name>\n");
165         xml.append(" <Value>").append(String.valueOf(relationStatus)).append("</Value>\n");
166         xml.append(" </Column>\n");
167         xml.append(" </Row>\n");
168         xml.append(" </Rows>\n");
169         xml.append("</MemberTutorSection>\n");
170         return xml.toString();
171     }
172
173     public static String JavaDoc getXML(Collection JavaDoc objMemberTutorBeans) {
174         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
175         Iterator JavaDoc iterator = objMemberTutorBeans.iterator();
176         xml.append("<MemberTutorSection>\n");
177         xml.append(" <Rows>\n");
178         while (iterator.hasNext()) {
179             MemberTutorBean objMemberTutorBean = (MemberTutorBean)iterator.next();
180             xml.append(" <Row>\n");
181             xml.append(" <Column>\n");
182             xml.append(" <Name>MemberID</Name>\n");
183             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.memberID)).append("</Value>\n");
184             xml.append(" </Column>\n");
185             xml.append(" <Column>\n");
186             xml.append(" <Name>MemberName</Name>\n");
187             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.memberName)).append("</Value>\n");
188             xml.append(" </Column>\n");
189             xml.append(" <Column>\n");
190             xml.append(" <Name>TutorID</Name>\n");
191             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.tutorID)).append("</Value>\n");
192             xml.append(" </Column>\n");
193             xml.append(" <Column>\n");
194             xml.append(" <Name>TutorName</Name>\n");
195             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.tutorName)).append("</Value>\n");
196             xml.append(" </Column>\n");
197             xml.append(" <Column>\n");
198             xml.append(" <Name>CreationDate</Name>\n");
199             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.creationDate)).append("</Value>\n");
200             xml.append(" </Column>\n");
201             xml.append(" <Column>\n");
202             xml.append(" <Name>ExpireDate</Name>\n");
203             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.expireDate)).append("</Value>\n");
204             xml.append(" </Column>\n");
205             xml.append(" <Column>\n");
206             xml.append(" <Name>RelationType</Name>\n");
207             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.relationType)).append("</Value>\n");
208             xml.append(" </Column>\n");
209             xml.append(" <Column>\n");
210             xml.append(" <Name>RelationOption</Name>\n");
211             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.relationOption)).append("</Value>\n");
212             xml.append(" </Column>\n");
213             xml.append(" <Column>\n");
214             xml.append(" <Name>RelationStatus</Name>\n");
215             xml.append(" <Value>").append(String.valueOf(objMemberTutorBean.relationStatus)).append("</Value>\n");
216             xml.append(" </Column>\n");
217             xml.append(" </Row>\n");
218         }//while
219
xml.append(" </Rows>\n");
220         xml.append("</MemberTutorSection>\n");
221         return xml.toString();
222     }
223 } //end of class MemberTutorBean
224
Popular Tags