KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/CompanyBean.java,v 1.10 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.10 $
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 import net.myvietnam.mvncore.util.StringUtil;
48
49 /*
50  * Included columns: CompanyID, GroupID, CompanyName, CompanyAddress, CompanyCity,
51  * CompanyCAP, CompanyProvince, CompanyRegion, CompanyPhone, CompanyFax,
52  * CompanyWebsite, CompanyEmail, CompanySpaceName, CompanySpaceHeader, CompanySpaceFooter,
53  * CompanyVATNumber, CompanyLogo, CompanyCss, CompanyCreationDate, CompanyModifiedDate
54  * Excluded columns:
55  */

56 public class CompanyBean {
57     private int companyID;
58     private int groupID;
59     private String JavaDoc companyName;
60     private String JavaDoc companyAddress;
61     private String JavaDoc companyCity;
62     private String JavaDoc companyCAP;
63     private String JavaDoc companyProvince;
64     private String JavaDoc companyRegion;
65     private String JavaDoc companyPhone;
66     private String JavaDoc companyFax;
67     private String JavaDoc companyWebsite;
68     private String JavaDoc companyEmail;
69     private String JavaDoc companySpaceName;
70     private String JavaDoc companySpaceHeader;
71     private String JavaDoc companySpaceFooter;
72     private String JavaDoc companyVATNumber;
73     private String JavaDoc companyLogo;
74     private String JavaDoc companyCss;
75     private Timestamp JavaDoc companyCreationDate;
76     private Timestamp JavaDoc companyModifiedDate;
77
78     public int getCompanyID() {
79         return companyID;
80     }
81     public void setCompanyID(int companyID) {
82         this.companyID = companyID;
83     }
84
85     public int getGroupID() {
86         return groupID;
87     }
88     public void setGroupID(int groupID) {
89         this.groupID = groupID;
90     }
91
92     public String JavaDoc getCompanyName() {
93         return companyName;
94     }
95     public void setCompanyName(String JavaDoc companyName) {
96         this.companyName = StringUtil.getEmptyStringIfNull(companyName);
97     }
98
99     public String JavaDoc getCompanyAddress() {
100         return companyAddress;
101     }
102     public void setCompanyAddress(String JavaDoc companyAddress) {
103         this.companyAddress = StringUtil.getEmptyStringIfNull(companyAddress);
104     }
105
106     public String JavaDoc getCompanyCity() {
107         return companyCity;
108     }
109     public void setCompanyCity(String JavaDoc companyCity) {
110         this.companyCity = StringUtil.getEmptyStringIfNull(companyCity);
111     }
112
113     public String JavaDoc getCompanyCAP() {
114         return companyCAP;
115     }
116     public void setCompanyCAP(String JavaDoc companyCAP) {
117         this.companyCAP = StringUtil.getEmptyStringIfNull(companyCAP);
118     }
119
120     public String JavaDoc getCompanyProvince() {
121         return companyProvince;
122     }
123     public void setCompanyProvince(String JavaDoc companyProvince) {
124         this.companyProvince = StringUtil.getEmptyStringIfNull(companyProvince);
125     }
126
127     public String JavaDoc getCompanyRegion() {
128         return companyRegion;
129     }
130     public void setCompanyRegion(String JavaDoc companyRegion) {
131         this.companyRegion = StringUtil.getEmptyStringIfNull(companyRegion);
132     }
133
134     public String JavaDoc getCompanyPhone() {
135         return companyPhone;
136     }
137     public void setCompanyPhone(String JavaDoc companyPhone) {
138         this.companyPhone = StringUtil.getEmptyStringIfNull(companyPhone);
139     }
140
141     public String JavaDoc getCompanyFax() {
142         return companyFax;
143     }
144     public void setCompanyFax(String JavaDoc companyFax) {
145         this.companyFax = StringUtil.getEmptyStringIfNull(companyFax);
146     }
147
148     public String JavaDoc getCompanyWebsite() {
149         return companyWebsite;
150     }
151     public void setCompanyWebsite(String JavaDoc companyWebsite) {
152         this.companyWebsite = StringUtil.getEmptyStringIfNull(companyWebsite);
153     }
154
155     public String JavaDoc getCompanyEmail() {
156         return companyEmail;
157     }
158     public void setCompanyEmail(String JavaDoc companyEmail) {
159         this.companyEmail = StringUtil.getEmptyStringIfNull(companyEmail);
160     }
161
162     public String JavaDoc getCompanySpaceName() {
163         return companySpaceName;
164     }
165     public void setCompanySpaceName(String JavaDoc companySpaceName) {
166         this.companySpaceName = StringUtil.getEmptyStringIfNull(companySpaceName);
167     }
168
169     public String JavaDoc getCompanySpaceHeader() {
170         return companySpaceHeader;
171     }
172     public void setCompanySpaceHeader(String JavaDoc companySpaceHeader) {
173         this.companySpaceHeader = StringUtil.getEmptyStringIfNull(companySpaceHeader);
174     }
175
176     public String JavaDoc getCompanySpaceFooter() {
177         return companySpaceFooter;
178     }
179     public void setCompanySpaceFooter(String JavaDoc companySpaceFooter) {
180         this.companySpaceFooter = StringUtil.getEmptyStringIfNull(companySpaceFooter);
181     }
182
183     public String JavaDoc getCompanyVATNumber() {
184         return companyVATNumber;
185     }
186     public void setCompanyVATNumber(String JavaDoc companyVATNumber) {
187         this.companyVATNumber = StringUtil.getEmptyStringIfNull(companyVATNumber);
188     }
189
190     public String JavaDoc getCompanyLogo() {
191         return companyLogo;
192     }
193     public void setCompanyLogo(String JavaDoc companyLogo) {
194         this.companyLogo = StringUtil.getEmptyStringIfNull(companyLogo);
195     }
196
197     public String JavaDoc getCompanyCss() {
198         return companyCss;
199     }
200     public void setCompanyCss(String JavaDoc companyCss) {
201         this.companyCss = StringUtil.getEmptyStringIfNull(companyCss);
202     }
203
204     public Timestamp JavaDoc getCompanyCreationDate() {
205         return companyCreationDate;
206     }
207     public void setCompanyCreationDate(Timestamp JavaDoc companyCreationDate) {
208         this.companyCreationDate = companyCreationDate;
209     }
210
211     public Timestamp JavaDoc getCompanyModifiedDate() {
212         return companyModifiedDate;
213     }
214     public void setCompanyModifiedDate(Timestamp JavaDoc companyModifiedDate) {
215         this.companyModifiedDate = companyModifiedDate;
216     }
217
218     public String JavaDoc getXML() {
219         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
220         xml.append("<CompanySection>\n");
221         xml.append(" <Rows>\n");
222         xml.append(" <Row>\n");
223         xml.append(" <Column>\n");
224         xml.append(" <Name>CompanyID</Name>\n");
225         xml.append(" <Value>").append(String.valueOf(companyID)).append("</Value>\n");
226         xml.append(" </Column>\n");
227         xml.append(" <Column>\n");
228         xml.append(" <Name>GroupID</Name>\n");
229         xml.append(" <Value>").append(String.valueOf(groupID)).append("</Value>\n");
230         xml.append(" </Column>\n");
231         xml.append(" <Column>\n");
232         xml.append(" <Name>CompanyName</Name>\n");
233         xml.append(" <Value>").append(String.valueOf(companyName)).append("</Value>\n");
234         xml.append(" </Column>\n");
235         xml.append(" <Column>\n");
236         xml.append(" <Name>CompanyAddress</Name>\n");
237         xml.append(" <Value>").append(String.valueOf(companyAddress)).append("</Value>\n");
238         xml.append(" </Column>\n");
239         xml.append(" <Column>\n");
240         xml.append(" <Name>CompanyCity</Name>\n");
241         xml.append(" <Value>").append(String.valueOf(companyCity)).append("</Value>\n");
242         xml.append(" </Column>\n");
243         xml.append(" <Column>\n");
244         xml.append(" <Name>CompanyCAP</Name>\n");
245         xml.append(" <Value>").append(String.valueOf(companyCAP)).append("</Value>\n");
246         xml.append(" </Column>\n");
247         xml.append(" <Column>\n");
248         xml.append(" <Name>CompanyProvince</Name>\n");
249         xml.append(" <Value>").append(String.valueOf(companyProvince)).append("</Value>\n");
250         xml.append(" </Column>\n");
251         xml.append(" <Column>\n");
252         xml.append(" <Name>CompanyRegion</Name>\n");
253         xml.append(" <Value>").append(String.valueOf(companyRegion)).append("</Value>\n");
254         xml.append(" </Column>\n");
255         xml.append(" <Column>\n");
256         xml.append(" <Name>CompanyPhone</Name>\n");
257         xml.append(" <Value>").append(String.valueOf(companyPhone)).append("</Value>\n");
258         xml.append(" </Column>\n");
259         xml.append(" <Column>\n");
260         xml.append(" <Name>CompanyFax</Name>\n");
261         xml.append(" <Value>").append(String.valueOf(companyFax)).append("</Value>\n");
262         xml.append(" </Column>\n");
263         xml.append(" <Column>\n");
264         xml.append(" <Name>CompanyWebsite</Name>\n");
265         xml.append(" <Value>").append(String.valueOf(companyWebsite)).append("</Value>\n");
266         xml.append(" </Column>\n");
267         xml.append(" <Column>\n");
268         xml.append(" <Name>CompanyEmail</Name>\n");
269         xml.append(" <Value>").append(String.valueOf(companyEmail)).append("</Value>\n");
270         xml.append(" </Column>\n");
271         xml.append(" <Column>\n");
272         xml.append(" <Name>CompanySpaceName</Name>\n");
273         xml.append(" <Value>").append(String.valueOf(companySpaceName)).append("</Value>\n");
274         xml.append(" </Column>\n");
275         xml.append(" <Column>\n");
276         xml.append(" <Name>CompanySpaceHeader</Name>\n");
277         xml.append(" <Value>").append(String.valueOf(companySpaceHeader)).append("</Value>\n");
278         xml.append(" </Column>\n");
279         xml.append(" <Column>\n");
280         xml.append(" <Name>CompanySpaceFooter</Name>\n");
281         xml.append(" <Value>").append(String.valueOf(companySpaceFooter)).append("</Value>\n");
282         xml.append(" </Column>\n");
283         xml.append(" <Column>\n");
284         xml.append(" <Name>CompanyVATNumber</Name>\n");
285         xml.append(" <Value>").append(String.valueOf(companyVATNumber)).append("</Value>\n");
286         xml.append(" </Column>\n");
287         xml.append(" <Column>\n");
288         xml.append(" <Name>CompanyLogo</Name>\n");
289         xml.append(" <Value>").append(String.valueOf(companyLogo)).append("</Value>\n");
290         xml.append(" </Column>\n");
291         xml.append(" <Column>\n");
292         xml.append(" <Name>CompanyCss</Name>\n");
293         xml.append(" <Value>").append(String.valueOf(companyCss)).append("</Value>\n");
294         xml.append(" </Column>\n");
295         xml.append(" <Column>\n");
296         xml.append(" <Name>CompanyCreationDate</Name>\n");
297         xml.append(" <Value>").append(String.valueOf(companyCreationDate)).append("</Value>\n");
298         xml.append(" </Column>\n");
299         xml.append(" <Column>\n");
300         xml.append(" <Name>CompanyModifiedDate</Name>\n");
301         xml.append(" <Value>").append(String.valueOf(companyModifiedDate)).append("</Value>\n");
302         xml.append(" </Column>\n");
303         xml.append(" </Row>\n");
304         xml.append(" </Rows>\n");
305         xml.append("</CompanySection>\n");
306         return xml.toString();
307     }
308
309     public static String JavaDoc getXML(Collection JavaDoc objCompanyBeans) {
310         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
311         Iterator JavaDoc iterator = objCompanyBeans.iterator();
312         xml.append("<CompanySection>\n");
313         xml.append(" <Rows>\n");
314         while (iterator.hasNext()) {
315             CompanyBean objCompanyBean = (CompanyBean)iterator.next();
316             xml.append(" <Row>\n");
317             xml.append(" <Column>\n");
318             xml.append(" <Name>CompanyID</Name>\n");
319             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyID)).append("</Value>\n");
320             xml.append(" </Column>\n");
321             xml.append(" <Column>\n");
322             xml.append(" <Name>GroupID</Name>\n");
323             xml.append(" <Value>").append(String.valueOf(objCompanyBean.groupID)).append("</Value>\n");
324             xml.append(" </Column>\n");
325             xml.append(" <Column>\n");
326             xml.append(" <Name>CompanyName</Name>\n");
327             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyName)).append("</Value>\n");
328             xml.append(" </Column>\n");
329             xml.append(" <Column>\n");
330             xml.append(" <Name>CompanyAddress</Name>\n");
331             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyAddress)).append("</Value>\n");
332             xml.append(" </Column>\n");
333             xml.append(" <Column>\n");
334             xml.append(" <Name>CompanyCity</Name>\n");
335             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCity)).append("</Value>\n");
336             xml.append(" </Column>\n");
337             xml.append(" <Column>\n");
338             xml.append(" <Name>CompanyCAP</Name>\n");
339             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCAP)).append("</Value>\n");
340             xml.append(" </Column>\n");
341             xml.append(" <Column>\n");
342             xml.append(" <Name>CompanyProvince</Name>\n");
343             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyProvince)).append("</Value>\n");
344             xml.append(" </Column>\n");
345             xml.append(" <Column>\n");
346             xml.append(" <Name>CompanyRegion</Name>\n");
347             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyRegion)).append("</Value>\n");
348             xml.append(" </Column>\n");
349             xml.append(" <Column>\n");
350             xml.append(" <Name>CompanyPhone</Name>\n");
351             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyPhone)).append("</Value>\n");
352             xml.append(" </Column>\n");
353             xml.append(" <Column>\n");
354             xml.append(" <Name>CompanyFax</Name>\n");
355             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyFax)).append("</Value>\n");
356             xml.append(" </Column>\n");
357             xml.append(" <Column>\n");
358             xml.append(" <Name>CompanyWebsite</Name>\n");
359             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyWebsite)).append("</Value>\n");
360             xml.append(" </Column>\n");
361             xml.append(" <Column>\n");
362             xml.append(" <Name>CompanyEmail</Name>\n");
363             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyEmail)).append("</Value>\n");
364             xml.append(" </Column>\n");
365             xml.append(" <Column>\n");
366             xml.append(" <Name>CompanySpaceName</Name>\n");
367             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companySpaceName)).append("</Value>\n");
368             xml.append(" </Column>\n");
369             xml.append(" <Column>\n");
370             xml.append(" <Name>CompanySpaceHeader</Name>\n");
371             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companySpaceHeader)).append("</Value>\n");
372             xml.append(" </Column>\n");
373             xml.append(" <Column>\n");
374             xml.append(" <Name>CompanySpaceFooter</Name>\n");
375             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companySpaceFooter)).append("</Value>\n");
376             xml.append(" </Column>\n");
377             xml.append(" <Column>\n");
378             xml.append(" <Name>CompanyVATNumber</Name>\n");
379             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyVATNumber)).append("</Value>\n");
380             xml.append(" </Column>\n");
381             xml.append(" <Column>\n");
382             xml.append(" <Name>CompanyLogo</Name>\n");
383             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyLogo)).append("</Value>\n");
384             xml.append(" </Column>\n");
385             xml.append(" <Column>\n");
386             xml.append(" <Name>CompanyCss</Name>\n");
387             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCss)).append("</Value>\n");
388             xml.append(" </Column>\n");
389             xml.append(" <Column>\n");
390             xml.append(" <Name>CompanyCreationDate</Name>\n");
391             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCreationDate)).append("</Value>\n");
392             xml.append(" </Column>\n");
393             xml.append(" <Column>\n");
394             xml.append(" <Name>CompanyModifiedDate</Name>\n");
395             xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyModifiedDate)).append("</Value>\n");
396             xml.append(" </Column>\n");
397             xml.append(" </Row>\n");
398         }//while
399
xml.append(" </Rows>\n");
400         xml.append("</CompanySection>\n");
401         return xml.toString();
402     }
403 } //end of class CompanyBean
404
Popular Tags