KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/PmAttachmentBean.java,v 1.8 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.8 $
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: PmAttachID, MemberID, PmAttachFilename, PmAttachFileSize,
51  * PmAttachMimeType, PmAttachDesc, PmAttachCreationIP, PmAttachCreationDate, PmAttachModifiedDate,
52  * PmAttachDownloadCount, PmAttachOption, PmAttachStatus
53  * Excluded columns:
54  */

55 public class PmAttachmentBean {
56     private int pmAttachID;
57     private int memberID;
58     private String JavaDoc pmAttachFilename;
59     private int pmAttachFileSize;
60     private String JavaDoc pmAttachMimeType;
61     private String JavaDoc pmAttachDesc;
62     private String JavaDoc pmAttachCreationIP;
63     private Timestamp JavaDoc pmAttachCreationDate;
64     private Timestamp JavaDoc pmAttachModifiedDate;
65     private int pmAttachDownloadCount;
66     private int pmAttachOption;
67     private int pmAttachStatus;
68
69     public int getPmAttachID() {
70         return pmAttachID;
71     }
72     public void setPmAttachID(int pmAttachID) {
73         this.pmAttachID = pmAttachID;
74     }
75
76     public int getMemberID() {
77         return memberID;
78     }
79     public void setMemberID(int memberID) {
80         this.memberID = memberID;
81     }
82
83     public String JavaDoc getPmAttachFilename() {
84         return pmAttachFilename;
85     }
86     public void setPmAttachFilename(String JavaDoc pmAttachFilename) {
87         this.pmAttachFilename = StringUtil.getEmptyStringIfNull(pmAttachFilename);
88     }
89
90     public int getPmAttachFileSize() {
91         return pmAttachFileSize;
92     }
93     public void setPmAttachFileSize(int pmAttachFileSize) {
94         this.pmAttachFileSize = pmAttachFileSize;
95     }
96
97     public String JavaDoc getPmAttachMimeType() {
98         return pmAttachMimeType;
99     }
100     public void setPmAttachMimeType(String JavaDoc pmAttachMimeType) {
101         this.pmAttachMimeType = StringUtil.getEmptyStringIfNull(pmAttachMimeType);
102     }
103
104     public String JavaDoc getPmAttachDesc() {
105         return pmAttachDesc;
106     }
107     public void setPmAttachDesc(String JavaDoc pmAttachDesc) {
108         this.pmAttachDesc = StringUtil.getEmptyStringIfNull(pmAttachDesc);
109     }
110
111     public String JavaDoc getPmAttachCreationIP() {
112         return pmAttachCreationIP;
113     }
114     public void setPmAttachCreationIP(String JavaDoc pmAttachCreationIP) {
115         this.pmAttachCreationIP = StringUtil.getEmptyStringIfNull(pmAttachCreationIP);
116     }
117
118     public Timestamp JavaDoc getPmAttachCreationDate() {
119         return pmAttachCreationDate;
120     }
121     public void setPmAttachCreationDate(Timestamp JavaDoc pmAttachCreationDate) {
122         this.pmAttachCreationDate = pmAttachCreationDate;
123     }
124
125     public Timestamp JavaDoc getPmAttachModifiedDate() {
126         return pmAttachModifiedDate;
127     }
128     public void setPmAttachModifiedDate(Timestamp JavaDoc pmAttachModifiedDate) {
129         this.pmAttachModifiedDate = pmAttachModifiedDate;
130     }
131
132     public int getPmAttachDownloadCount() {
133         return pmAttachDownloadCount;
134     }
135     public void setPmAttachDownloadCount(int pmAttachDownloadCount) {
136         this.pmAttachDownloadCount = pmAttachDownloadCount;
137     }
138
139     public int getPmAttachOption() {
140         return pmAttachOption;
141     }
142     public void setPmAttachOption(int pmAttachOption) {
143         this.pmAttachOption = pmAttachOption;
144     }
145
146     public int getPmAttachStatus() {
147         return pmAttachStatus;
148     }
149     public void setPmAttachStatus(int pmAttachStatus) {
150         this.pmAttachStatus = pmAttachStatus;
151     }
152
153     public String JavaDoc getXML() {
154         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
155         xml.append("<PmAttachmentSection>\n");
156         xml.append(" <Rows>\n");
157         xml.append(" <Row>\n");
158         xml.append(" <Column>\n");
159         xml.append(" <Name>PmAttachID</Name>\n");
160         xml.append(" <Value>").append(String.valueOf(pmAttachID)).append("</Value>\n");
161         xml.append(" </Column>\n");
162         xml.append(" <Column>\n");
163         xml.append(" <Name>MemberID</Name>\n");
164         xml.append(" <Value>").append(String.valueOf(memberID)).append("</Value>\n");
165         xml.append(" </Column>\n");
166         xml.append(" <Column>\n");
167         xml.append(" <Name>PmAttachFilename</Name>\n");
168         xml.append(" <Value>").append(String.valueOf(pmAttachFilename)).append("</Value>\n");
169         xml.append(" </Column>\n");
170         xml.append(" <Column>\n");
171         xml.append(" <Name>PmAttachFileSize</Name>\n");
172         xml.append(" <Value>").append(String.valueOf(pmAttachFileSize)).append("</Value>\n");
173         xml.append(" </Column>\n");
174         xml.append(" <Column>\n");
175         xml.append(" <Name>PmAttachMimeType</Name>\n");
176         xml.append(" <Value>").append(String.valueOf(pmAttachMimeType)).append("</Value>\n");
177         xml.append(" </Column>\n");
178         xml.append(" <Column>\n");
179         xml.append(" <Name>PmAttachDesc</Name>\n");
180         xml.append(" <Value>").append(String.valueOf(pmAttachDesc)).append("</Value>\n");
181         xml.append(" </Column>\n");
182         xml.append(" <Column>\n");
183         xml.append(" <Name>PmAttachCreationIP</Name>\n");
184         xml.append(" <Value>").append(String.valueOf(pmAttachCreationIP)).append("</Value>\n");
185         xml.append(" </Column>\n");
186         xml.append(" <Column>\n");
187         xml.append(" <Name>PmAttachCreationDate</Name>\n");
188         xml.append(" <Value>").append(String.valueOf(pmAttachCreationDate)).append("</Value>\n");
189         xml.append(" </Column>\n");
190         xml.append(" <Column>\n");
191         xml.append(" <Name>PmAttachModifiedDate</Name>\n");
192         xml.append(" <Value>").append(String.valueOf(pmAttachModifiedDate)).append("</Value>\n");
193         xml.append(" </Column>\n");
194         xml.append(" <Column>\n");
195         xml.append(" <Name>PmAttachDownloadCount</Name>\n");
196         xml.append(" <Value>").append(String.valueOf(pmAttachDownloadCount)).append("</Value>\n");
197         xml.append(" </Column>\n");
198         xml.append(" <Column>\n");
199         xml.append(" <Name>PmAttachOption</Name>\n");
200         xml.append(" <Value>").append(String.valueOf(pmAttachOption)).append("</Value>\n");
201         xml.append(" </Column>\n");
202         xml.append(" <Column>\n");
203         xml.append(" <Name>PmAttachStatus</Name>\n");
204         xml.append(" <Value>").append(String.valueOf(pmAttachStatus)).append("</Value>\n");
205         xml.append(" </Column>\n");
206         xml.append(" </Row>\n");
207         xml.append(" </Rows>\n");
208         xml.append("</PmAttachmentSection>\n");
209         return xml.toString();
210     }
211
212     public static String JavaDoc getXML(Collection JavaDoc objPmAttachmentBeans) {
213         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
214         Iterator JavaDoc iterator = objPmAttachmentBeans.iterator();
215         xml.append("<PmAttachmentSection>\n");
216         xml.append(" <Rows>\n");
217         while (iterator.hasNext()) {
218             PmAttachmentBean objPmAttachmentBean = (PmAttachmentBean)iterator.next();
219             xml.append(" <Row>\n");
220             xml.append(" <Column>\n");
221             xml.append(" <Name>PmAttachID</Name>\n");
222             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachID)).append("</Value>\n");
223             xml.append(" </Column>\n");
224             xml.append(" <Column>\n");
225             xml.append(" <Name>MemberID</Name>\n");
226             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.memberID)).append("</Value>\n");
227             xml.append(" </Column>\n");
228             xml.append(" <Column>\n");
229             xml.append(" <Name>PmAttachFilename</Name>\n");
230             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachFilename)).append("</Value>\n");
231             xml.append(" </Column>\n");
232             xml.append(" <Column>\n");
233             xml.append(" <Name>PmAttachFileSize</Name>\n");
234             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachFileSize)).append("</Value>\n");
235             xml.append(" </Column>\n");
236             xml.append(" <Column>\n");
237             xml.append(" <Name>PmAttachMimeType</Name>\n");
238             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachMimeType)).append("</Value>\n");
239             xml.append(" </Column>\n");
240             xml.append(" <Column>\n");
241             xml.append(" <Name>PmAttachDesc</Name>\n");
242             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachDesc)).append("</Value>\n");
243             xml.append(" </Column>\n");
244             xml.append(" <Column>\n");
245             xml.append(" <Name>PmAttachCreationIP</Name>\n");
246             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachCreationIP)).append("</Value>\n");
247             xml.append(" </Column>\n");
248             xml.append(" <Column>\n");
249             xml.append(" <Name>PmAttachCreationDate</Name>\n");
250             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachCreationDate)).append("</Value>\n");
251             xml.append(" </Column>\n");
252             xml.append(" <Column>\n");
253             xml.append(" <Name>PmAttachModifiedDate</Name>\n");
254             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachModifiedDate)).append("</Value>\n");
255             xml.append(" </Column>\n");
256             xml.append(" <Column>\n");
257             xml.append(" <Name>PmAttachDownloadCount</Name>\n");
258             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachDownloadCount)).append("</Value>\n");
259             xml.append(" </Column>\n");
260             xml.append(" <Column>\n");
261             xml.append(" <Name>PmAttachOption</Name>\n");
262             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachOption)).append("</Value>\n");
263             xml.append(" </Column>\n");
264             xml.append(" <Column>\n");
265             xml.append(" <Name>PmAttachStatus</Name>\n");
266             xml.append(" <Value>").append(String.valueOf(objPmAttachmentBean.pmAttachStatus)).append("</Value>\n");
267             xml.append(" </Column>\n");
268             xml.append(" </Row>\n");
269         }//while
270
xml.append(" </Rows>\n");
271         xml.append("</PmAttachmentSection>\n");
272         return xml.toString();
273     }
274 } //end of class PmAttachmentBean
275
Popular Tags