1 41 package com.mvnforum.db; 42 43 import java.sql.Timestamp ; 44 import java.util.Collection ; 45 import java.util.Iterator ; 46 47 52 public class MemberTutorBean { 53 private int memberID; 54 private String memberName; 55 private int tutorID; 56 private String tutorName; 57 private Timestamp creationDate; 58 private Timestamp 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 getMemberName() { 71 return memberName; 72 } 73 public void setMemberName(String 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 getTutorName() { 85 return tutorName; 86 } 87 public void setTutorName(String tutorName) { 88 this.tutorName = tutorName; 89 } 90 91 public Timestamp getCreationDate() { 92 return creationDate; 93 } 94 public void setCreationDate(Timestamp creationDate) { 95 this.creationDate = creationDate; 96 } 97 98 public Timestamp getExpireDate() { 99 return expireDate; 100 } 101 public void setExpireDate(Timestamp 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 getXML() { 127 StringBuffer xml = new StringBuffer (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 getXML(Collection objMemberTutorBeans) { 174 StringBuffer xml = new StringBuffer (1024); 175 Iterator 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 } xml.append(" </Rows>\n"); 220 xml.append("</MemberTutorSection>\n"); 221 return xml.toString(); 222 } 223 } | Popular Tags |