|
What this is
Other links
The source code/* * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/FavoriteThreadBean.java,v 1.4 2005/01/18 11:52:17 minhnn Exp $ * $Author: minhnn $ * $Revision: 1.4 $ * $Date: 2005/01/18 11:52:17 $ * * ==================================================================== * * Copyright (C) 2002-2005 by MyVietnam.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * All copyright notices regarding mvnForum MUST remain intact * in the scripts and in the outputted HTML. * The "powered by" text/logo with a link back to * http://www.mvnForum.com and http://www.MyVietnam.net in the * footer of the pages MUST remain visible when the pages * are viewed on the internet or intranet. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Support can be obtained from support forums at: * http://www.mvnForum.com/mvnforum/index * * Correspondence and Marketing Questions can be sent to: * info@MyVietnam.net * * @author: Minh Nguyen minhnn@MyVietnam.net * @author: Mai Nguyen mai.nh@MyVietnam.net */ package com.mvnforum.db; import java.sql.Timestamp; import java.util.Collection; import java.util.Iterator; /* * Included columns: MemberID, ThreadID, ForumID, FavoriteCreationDate, FavoriteType, * FavoriteOption, FavoriteStatus * Excluded columns: */ public class FavoriteThreadBean { private int memberID; private int threadID; private int forumID; private Timestamp favoriteCreationDate; private int favoriteType; private int favoriteOption; private int favoriteStatus; public int getMemberID() { return memberID; } public void setMemberID(int memberID) { this.memberID = memberID; } public int getThreadID() { return threadID; } public void setThreadID(int threadID) { this.threadID = threadID; } public int getForumID() { return forumID; } public void setForumID(int forumID) { this.forumID = forumID; } public Timestamp getFavoriteCreationDate() { return favoriteCreationDate; } public void setFavoriteCreationDate(Timestamp favoriteCreationDate) { this.favoriteCreationDate = favoriteCreationDate; } public int getFavoriteType() { return favoriteType; } public void setFavoriteType(int favoriteType) { this.favoriteType = favoriteType; } public int getFavoriteOption() { return favoriteOption; } public void setFavoriteOption(int favoriteOption) { this.favoriteOption = favoriteOption; } public int getFavoriteStatus() { return favoriteStatus; } public void setFavoriteStatus(int favoriteStatus) { this.favoriteStatus = favoriteStatus; } public String getXML() { StringBuffer xml = new StringBuffer(1024); xml.append("<FavoriteThreadSection>\n"); xml.append(" <Rows>\n"); xml.append(" <Row>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MemberID\n"); xml.append(" <Value>").append(String.valueOf(memberID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>ThreadID\n"); xml.append(" <Value>").append(String.valueOf(threadID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>ForumID\n"); xml.append(" <Value>").append(String.valueOf(forumID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteCreationDate\n"); xml.append(" <Value>").append(String.valueOf(favoriteCreationDate)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteType\n"); xml.append(" <Value>").append(String.valueOf(favoriteType)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteOption\n"); xml.append(" <Value>").append(String.valueOf(favoriteOption)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteStatus\n"); xml.append(" <Value>").append(String.valueOf(favoriteStatus)).append("\n"); xml.append(" </Column>\n"); xml.append(" </Row>\n"); xml.append(" </Rows>\n"); xml.append("</FavoriteThreadSection>\n"); return xml.toString(); } public static String getXML(Collection objFavoriteThreadBeans) { StringBuffer xml = new StringBuffer(1024); Iterator iterator = objFavoriteThreadBeans.iterator(); xml.append("<FavoriteThreadSection>\n"); xml.append(" <Rows>\n"); while (iterator.hasNext()) { FavoriteThreadBean objFavoriteThreadBean = (FavoriteThreadBean)iterator.next(); xml.append(" <Row>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MemberID\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.memberID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>ThreadID\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.threadID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>ForumID\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.forumID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteCreationDate\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteCreationDate)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteType\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteType)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteOption\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteOption)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FavoriteStatus\n"); xml.append(" <Value>").append(String.valueOf(objFavoriteThreadBean.favoriteStatus)).append("\n"); xml.append(" </Column>\n"); xml.append(" </Row>\n"); }//while xml.append(" </Rows>\n"); xml.append("</FavoriteThreadSection>\n"); return xml.toString(); } } //end of class FavoriteThreadBean |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.