1 41 package com.mvnforum.db; 42 43 import java.sql.Timestamp ; 44 import java.util.Collection ; 45 import java.util.Iterator ; 46 47 import net.myvietnam.mvncore.util.StringUtil; 48 49 55 public class AttachmentBean { 56 private int attachID; 57 private int postID; 58 private int memberID; 59 private String attachFilename; 60 private int attachFileSize; 61 private String attachMimeType; 62 private String attachDesc; 63 private String attachCreationIP; 64 private Timestamp attachCreationDate; 65 private Timestamp attachModifiedDate; 66 private int attachDownloadCount; 67 private int attachOption; 68 private int attachStatus; 69 70 public int getAttachID() { 71 return attachID; 72 } 73 public void setAttachID(int attachID) { 74 this.attachID = attachID; 75 } 76 77 public int getPostID() { 78 return postID; 79 } 80 public void setPostID(int postID) { 81 this.postID = postID; 82 } 83 84 public int getMemberID() { 85 return memberID; 86 } 87 public void setMemberID(int memberID) { 88 this.memberID = memberID; 89 } 90 91 public String getAttachFilename() { 92 return attachFilename; 93 } 94 public void setAttachFilename(String attachFilename) { 95 this.attachFilename = StringUtil.getEmptyStringIfNull(attachFilename); 96 } 97 98 public int getAttachFileSize() { 99 return attachFileSize; 100 } 101 public void setAttachFileSize(int attachFileSize) { 102 this.attachFileSize = attachFileSize; 103 } 104 105 public String getAttachMimeType() { 106 return attachMimeType; 107 } 108 public void setAttachMimeType(String attachMimeType) { 109 this.attachMimeType = StringUtil.getEmptyStringIfNull(attachMimeType); 110 } 111 112 public String getAttachDesc() { 113 return attachDesc; 114 } 115 public void setAttachDesc(String attachDesc) { 116 this.attachDesc = StringUtil.getEmptyStringIfNull(attachDesc); 117 } 118 119 public String getAttachCreationIP() { 120 return attachCreationIP; 121 } 122 public void setAttachCreationIP(String attachCreationIP) { 123 this.attachCreationIP = StringUtil.getEmptyStringIfNull(attachCreationIP); 124 } 125 126 public Timestamp getAttachCreationDate() { 127 return attachCreationDate; 128 } 129 public void setAttachCreationDate(Timestamp attachCreationDate) { 130 this.attachCreationDate = attachCreationDate; 131 } 132 133 public Timestamp getAttachModifiedDate() { 134 return attachModifiedDate; 135 } 136 public void setAttachModifiedDate(Timestamp attachModifiedDate) { 137 this.attachModifiedDate = attachModifiedDate; 138 } 139 140 public int getAttachDownloadCount() { 141 return attachDownloadCount; 142 } 143 public void setAttachDownloadCount(int attachDownloadCount) { 144 this.attachDownloadCount = attachDownloadCount; 145 } 146 147 public int getAttachOption() { 148 return attachOption; 149 } 150 public void setAttachOption(int attachOption) { 151 this.attachOption = attachOption; 152 } 153 154 public int getAttachStatus() { 155 return attachStatus; 156 } 157 public void setAttachStatus(int attachStatus) { 158 this.attachStatus = attachStatus; 159 } 160 161 public String getXML() { 162 StringBuffer xml = new StringBuffer (1024); 163 xml.append("<AttachmentSection>\n"); 164 xml.append(" <Rows>\n"); 165 xml.append(" <Row>\n"); 166 xml.append(" <Column>\n"); 167 xml.append(" <Name>AttachID</Name>\n"); 168 xml.append(" <Value>").append(String.valueOf(attachID)).append("</Value>\n"); 169 xml.append(" </Column>\n"); 170 xml.append(" <Column>\n"); 171 xml.append(" <Name>PostID</Name>\n"); 172 xml.append(" <Value>").append(String.valueOf(postID)).append("</Value>\n"); 173 xml.append(" </Column>\n"); 174 xml.append(" <Column>\n"); 175 xml.append(" <Name>MemberID</Name>\n"); 176 xml.append(" <Value>").append(String.valueOf(memberID)).append("</Value>\n"); 177 xml.append(" </Column>\n"); 178 xml.append(" <Column>\n"); 179 xml.append(" <Name>AttachFilename</Name>\n"); 180 xml.append(" <Value>").append(String.valueOf(attachFilename)).append("</Value>\n"); 181 xml.append(" </Column>\n"); 182 xml.append(" <Column>\n"); 183 xml.append(" <Name>AttachFileSize</Name>\n"); 184 xml.append(" <Value>").append(String.valueOf(attachFileSize)).append("</Value>\n"); 185 xml.append(" </Column>\n"); 186 xml.append(" <Column>\n"); 187 xml.append(" <Name>AttachMimeType</Name>\n"); 188 xml.append(" <Value>").append(String.valueOf(attachMimeType)).append("</Value>\n"); 189 xml.append(" </Column>\n"); 190 xml.append(" <Column>\n"); 191 xml.append(" <Name>AttachDesc</Name>\n"); 192 xml.append(" <Value>").append(String.valueOf(attachDesc)).append("</Value>\n"); 193 xml.append(" </Column>\n"); 194 xml.append(" <Column>\n"); 195 xml.append(" <Name>AttachCreationIP</Name>\n"); 196 xml.append(" <Value>").append(String.valueOf(attachCreationIP)).append("</Value>\n"); 197 xml.append(" </Column>\n"); 198 xml.append(" <Column>\n"); 199 xml.append(" <Name>AttachCreationDate</Name>\n"); 200 xml.append(" <Value>").append(String.valueOf(attachCreationDate)).append("</Value>\n"); 201 xml.append(" </Column>\n"); 202 xml.append(" <Column>\n"); 203 xml.append(" <Name>AttachModifiedDate</Name>\n"); 204 xml.append(" <Value>").append(String.valueOf(attachModifiedDate)).append("</Value>\n"); 205 xml.append(" </Column>\n"); 206 xml.append(" <Column>\n"); 207 xml.append(" <Name>AttachDownloadCount</Name>\n"); 208 xml.append(" <Value>").append(String.valueOf(attachDownloadCount)).append("</Value>\n"); 209 xml.append(" </Column>\n"); 210 xml.append(" <Column>\n"); 211 xml.append(" <Name>AttachOption</Name>\n"); 212 xml.append(" <Value>").append(String.valueOf(attachOption)).append("</Value>\n"); 213 xml.append(" </Column>\n"); 214 xml.append(" <Column>\n"); 215 xml.append(" <Name>AttachStatus</Name>\n"); 216 xml.append(" <Value>").append(String.valueOf(attachStatus)).append("</Value>\n"); 217 xml.append(" </Column>\n"); 218 xml.append(" </Row>\n"); 219 xml.append(" </Rows>\n"); 220 xml.append("</AttachmentSection>\n"); 221 return xml.toString(); 222 } 223 224 public static String getXML(Collection objAttachmentBeans) { 225 StringBuffer xml = new StringBuffer (1024); 226 Iterator iterator = objAttachmentBeans.iterator(); 227 xml.append("<AttachmentSection>\n"); 228 xml.append(" <Rows>\n"); 229 while (iterator.hasNext()) { 230 AttachmentBean objAttachmentBean = (AttachmentBean)iterator.next(); 231 xml.append(" <Row>\n"); 232 xml.append(" <Column>\n"); 233 xml.append(" <Name>AttachID</Name>\n"); 234 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachID)).append("</Value>\n"); 235 xml.append(" </Column>\n"); 236 xml.append(" <Column>\n"); 237 xml.append(" <Name>PostID</Name>\n"); 238 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.postID)).append("</Value>\n"); 239 xml.append(" </Column>\n"); 240 xml.append(" <Column>\n"); 241 xml.append(" <Name>MemberID</Name>\n"); 242 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.memberID)).append("</Value>\n"); 243 xml.append(" </Column>\n"); 244 xml.append(" <Column>\n"); 245 xml.append(" <Name>AttachFilename</Name>\n"); 246 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachFilename)).append("</Value>\n"); 247 xml.append(" </Column>\n"); 248 xml.append(" <Column>\n"); 249 xml.append(" <Name>AttachFileSize</Name>\n"); 250 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachFileSize)).append("</Value>\n"); 251 xml.append(" </Column>\n"); 252 xml.append(" <Column>\n"); 253 xml.append(" <Name>AttachMimeType</Name>\n"); 254 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachMimeType)).append("</Value>\n"); 255 xml.append(" </Column>\n"); 256 xml.append(" <Column>\n"); 257 xml.append(" <Name>AttachDesc</Name>\n"); 258 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachDesc)).append("</Value>\n"); 259 xml.append(" </Column>\n"); 260 xml.append(" <Column>\n"); 261 xml.append(" <Name>AttachCreationIP</Name>\n"); 262 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachCreationIP)).append("</Value>\n"); 263 xml.append(" </Column>\n"); 264 xml.append(" <Column>\n"); 265 xml.append(" <Name>AttachCreationDate</Name>\n"); 266 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachCreationDate)).append("</Value>\n"); 267 xml.append(" </Column>\n"); 268 xml.append(" <Column>\n"); 269 xml.append(" <Name>AttachModifiedDate</Name>\n"); 270 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachModifiedDate)).append("</Value>\n"); 271 xml.append(" </Column>\n"); 272 xml.append(" <Column>\n"); 273 xml.append(" <Name>AttachDownloadCount</Name>\n"); 274 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachDownloadCount)).append("</Value>\n"); 275 xml.append(" </Column>\n"); 276 xml.append(" <Column>\n"); 277 xml.append(" <Name>AttachOption</Name>\n"); 278 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachOption)).append("</Value>\n"); 279 xml.append(" </Column>\n"); 280 xml.append(" <Column>\n"); 281 xml.append(" <Name>AttachStatus</Name>\n"); 282 xml.append(" <Value>").append(String.valueOf(objAttachmentBean.attachStatus)).append("</Value>\n"); 283 xml.append(" </Column>\n"); 284 xml.append(" </Row>\n"); 285 } xml.append(" </Rows>\n"); 287 xml.append("</AttachmentSection>\n"); 288 return xml.toString(); 289 } 290 } | Popular Tags |