1 41 package com.mvnforum.db; 42 43 import java.sql.Timestamp ; 44 import java.util.Collection ; 45 import java.util.Iterator ; 46 47 53 public class WatchBean { 54 58 public final static int WATCH_OPTION_DEFAULT= 0; 59 public final static int WATCH_OPTION_LIVE = 1; 60 public final static int WATCH_OPTION_HOURLY = 2; 61 public final static int WATCH_OPTION_DAILY = 3; 62 public final static int WATCH_OPTION_WEEKLY = 4; 63 64 private int watchID; 65 private int memberID; 66 private int categoryID; 67 private int forumID; 68 private int threadID; 69 private int watchType; 70 private int watchOption; 71 private int watchStatus; 72 private Timestamp watchCreationDate; 73 private Timestamp watchLastSentDate; 74 private Timestamp watchEndDate; 75 76 public int getWatchID() { 77 return watchID; 78 } 79 public void setWatchID(int watchID) { 80 this.watchID = watchID; 81 } 82 83 public int getMemberID() { 84 return memberID; 85 } 86 public void setMemberID(int memberID) { 87 this.memberID = memberID; 88 } 89 90 public int getCategoryID() { 91 return categoryID; 92 } 93 public void setCategoryID(int categoryID) { 94 this.categoryID = categoryID; 95 } 96 97 public int getForumID() { 98 return forumID; 99 } 100 public void setForumID(int forumID) { 101 this.forumID = forumID; 102 } 103 104 public int getThreadID() { 105 return threadID; 106 } 107 public void setThreadID(int threadID) { 108 this.threadID = threadID; 109 } 110 111 public int getWatchType() { 112 return watchType; 113 } 114 public void setWatchType(int watchType) { 115 this.watchType = watchType; 116 } 117 118 public int getWatchOption() { 119 return watchOption; 120 } 121 public void setWatchOption(int watchOption) { 122 this.watchOption = watchOption; 123 } 124 125 public int getWatchStatus() { 126 return watchStatus; 127 } 128 public void setWatchStatus(int watchStatus) { 129 this.watchStatus = watchStatus; 130 } 131 132 public Timestamp getWatchCreationDate() { 133 return watchCreationDate; 134 } 135 public void setWatchCreationDate(Timestamp watchCreationDate) { 136 this.watchCreationDate = watchCreationDate; 137 } 138 139 public Timestamp getWatchLastSentDate() { 140 return watchLastSentDate; 141 } 142 public void setWatchLastSentDate(Timestamp watchLastSentDate) { 143 this.watchLastSentDate = watchLastSentDate; 144 } 145 146 public Timestamp getWatchEndDate() { 147 return watchEndDate; 148 } 149 public void setWatchEndDate(Timestamp watchEndDate) { 150 this.watchEndDate = watchEndDate; 151 } 152 153 public String getXML() { 154 StringBuffer xml = new StringBuffer (1024); 155 xml.append("<WatchSection>\n"); 156 xml.append(" <Rows>\n"); 157 xml.append(" <Row>\n"); 158 xml.append(" <Column>\n"); 159 xml.append(" <Name>WatchID</Name>\n"); 160 xml.append(" <Value>").append(String.valueOf(watchID)).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>CategoryID</Name>\n"); 168 xml.append(" <Value>").append(String.valueOf(categoryID)).append("</Value>\n"); 169 xml.append(" </Column>\n"); 170 xml.append(" <Column>\n"); 171 xml.append(" <Name>ForumID</Name>\n"); 172 xml.append(" <Value>").append(String.valueOf(forumID)).append("</Value>\n"); 173 xml.append(" </Column>\n"); 174 xml.append(" <Column>\n"); 175 xml.append(" <Name>ThreadID</Name>\n"); 176 xml.append(" <Value>").append(String.valueOf(threadID)).append("</Value>\n"); 177 xml.append(" </Column>\n"); 178 xml.append(" <Column>\n"); 179 xml.append(" <Name>WatchType</Name>\n"); 180 xml.append(" <Value>").append(String.valueOf(watchType)).append("</Value>\n"); 181 xml.append(" </Column>\n"); 182 xml.append(" <Column>\n"); 183 xml.append(" <Name>WatchOption</Name>\n"); 184 xml.append(" <Value>").append(String.valueOf(watchOption)).append("</Value>\n"); 185 xml.append(" </Column>\n"); 186 xml.append(" <Column>\n"); 187 xml.append(" <Name>WatchStatus</Name>\n"); 188 xml.append(" <Value>").append(String.valueOf(watchStatus)).append("</Value>\n"); 189 xml.append(" </Column>\n"); 190 xml.append(" <Column>\n"); 191 xml.append(" <Name>WatchCreationDate</Name>\n"); 192 xml.append(" <Value>").append(String.valueOf(watchCreationDate)).append("</Value>\n"); 193 xml.append(" </Column>\n"); 194 xml.append(" <Column>\n"); 195 xml.append(" <Name>WatchLastSentDate</Name>\n"); 196 xml.append(" <Value>").append(String.valueOf(watchLastSentDate)).append("</Value>\n"); 197 xml.append(" </Column>\n"); 198 xml.append(" <Column>\n"); 199 xml.append(" <Name>WatchEndDate</Name>\n"); 200 xml.append(" <Value>").append(String.valueOf(watchEndDate)).append("</Value>\n"); 201 xml.append(" </Column>\n"); 202 xml.append(" </Row>\n"); 203 xml.append(" </Rows>\n"); 204 xml.append("</WatchSection>\n"); 205 return xml.toString(); 206 } 207 208 public static String getXML(Collection objWatchBeans) { 209 StringBuffer xml = new StringBuffer (1024); 210 Iterator iterator = objWatchBeans.iterator(); 211 xml.append("<WatchSection>\n"); 212 xml.append(" <Rows>\n"); 213 while (iterator.hasNext()) { 214 WatchBean objWatchBean = (WatchBean)iterator.next(); 215 xml.append(" <Row>\n"); 216 xml.append(" <Column>\n"); 217 xml.append(" <Name>WatchID</Name>\n"); 218 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchID)).append("</Value>\n"); 219 xml.append(" </Column>\n"); 220 xml.append(" <Column>\n"); 221 xml.append(" <Name>MemberID</Name>\n"); 222 xml.append(" <Value>").append(String.valueOf(objWatchBean.memberID)).append("</Value>\n"); 223 xml.append(" </Column>\n"); 224 xml.append(" <Column>\n"); 225 xml.append(" <Name>CategoryID</Name>\n"); 226 xml.append(" <Value>").append(String.valueOf(objWatchBean.categoryID)).append("</Value>\n"); 227 xml.append(" </Column>\n"); 228 xml.append(" <Column>\n"); 229 xml.append(" <Name>ForumID</Name>\n"); 230 xml.append(" <Value>").append(String.valueOf(objWatchBean.forumID)).append("</Value>\n"); 231 xml.append(" </Column>\n"); 232 xml.append(" <Column>\n"); 233 xml.append(" <Name>ThreadID</Name>\n"); 234 xml.append(" <Value>").append(String.valueOf(objWatchBean.threadID)).append("</Value>\n"); 235 xml.append(" </Column>\n"); 236 xml.append(" <Column>\n"); 237 xml.append(" <Name>WatchType</Name>\n"); 238 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchType)).append("</Value>\n"); 239 xml.append(" </Column>\n"); 240 xml.append(" <Column>\n"); 241 xml.append(" <Name>WatchOption</Name>\n"); 242 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchOption)).append("</Value>\n"); 243 xml.append(" </Column>\n"); 244 xml.append(" <Column>\n"); 245 xml.append(" <Name>WatchStatus</Name>\n"); 246 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchStatus)).append("</Value>\n"); 247 xml.append(" </Column>\n"); 248 xml.append(" <Column>\n"); 249 xml.append(" <Name>WatchCreationDate</Name>\n"); 250 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchCreationDate)).append("</Value>\n"); 251 xml.append(" </Column>\n"); 252 xml.append(" <Column>\n"); 253 xml.append(" <Name>WatchLastSentDate</Name>\n"); 254 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchLastSentDate)).append("</Value>\n"); 255 xml.append(" </Column>\n"); 256 xml.append(" <Column>\n"); 257 xml.append(" <Name>WatchEndDate</Name>\n"); 258 xml.append(" <Value>").append(String.valueOf(objWatchBean.watchEndDate)).append("</Value>\n"); 259 xml.append(" </Column>\n"); 260 xml.append(" </Row>\n"); 261 } xml.append(" </Rows>\n"); 263 xml.append("</WatchSection>\n"); 264 return xml.toString(); 265 } 266 267 ThreadBean threadBean = null; 269 270 public ThreadBean getThreadBean() { 271 return threadBean; 272 } 273 public void setThreadBean(ThreadBean threadBean) { 274 this.threadBean = threadBean; 275 } 276 277 } | Popular Tags |