001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/ForumDAO.java,v 1.19 2007/10/09 11:09:18 lexuanttkhtn Exp $
003: * $Author: lexuanttkhtn $
004: * $Revision: 1.19 $
005: * $Date: 2007/10/09 11:09:18 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding mvnForum MUST remain
012: * intact in the scripts and in the outputted HTML.
013: * The "powered by" text/logo with a link back to
014: * http://www.mvnForum.com and http://www.MyVietnam.net in
015: * the footer of the pages MUST remain visible when the pages
016: * are viewed on the internet or intranet.
017: *
018: * This program is free software; you can redistribute it and/or modify
019: * it under the terms of the GNU General Public License as published by
020: * the Free Software Foundation; either version 2 of the License, or
021: * any later version.
022: *
023: * This program is distributed in the hope that it will be useful,
024: * but WITHOUT ANY WARRANTY; without even the implied warranty of
025: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026: * GNU General Public License for more details.
027: *
028: * You should have received a copy of the GNU General Public License
029: * along with this program; if not, write to the Free Software
030: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
031: *
032: * Support can be obtained from support forums at:
033: * http://www.mvnForum.com/mvnforum/index
034: *
035: * Correspondence and Marketing Questions can be sent to:
036: * info at MyVietnam net
037: *
038: * @author: Minh Nguyen
039: */
040: package com.mvnforum.db;
041:
042: import java.sql.Timestamp;
043: import java.util.Collection;
044:
045: import net.myvietnam.mvncore.exception.CreateException;
046: import net.myvietnam.mvncore.exception.DatabaseException;
047: import net.myvietnam.mvncore.exception.DuplicateKeyException;
048: import net.myvietnam.mvncore.exception.ObjectNotFoundException;
049: import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException;
050:
051: public interface ForumDAO {
052:
053: public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX
054: + "Forum";
055:
056: public void findByPrimaryKey(int forumID)
057: throws ObjectNotFoundException, DatabaseException;
058:
059: public void findByAlternateKey_ForumName_CategoryID(
060: String forumName, int categoryID)
061: throws ObjectNotFoundException, DatabaseException;
062:
063: public void create(int categoryID, String forumOwnerName,
064: String lastPostMemberName, String forumName,
065: String forumDesc, Timestamp forumCreationDate,
066: Timestamp forumModifiedDate, Timestamp forumLastPostDate,
067: int forumOrder, int forumType, int forumFormatOption,
068: int forumOption, int forumStatus, int forumModerationMode,
069: String forumPassword, int forumThreadCount,
070: int forumPostCount) throws CreateException,
071: DatabaseException, DuplicateKeyException,
072: ForeignKeyNotFoundException;
073:
074: public int createForum(int categoryID, String forumOwnerName,
075: String lastPostMemberName, String forumName,
076: String forumDesc, Timestamp forumCreationDate,
077: Timestamp forumModifiedDate, Timestamp forumLastPostDate,
078: int forumOrder, int forumType, int forumFormatOption,
079: int forumOption, int forumStatus, int forumModerationMode,
080: String forumPassword, int forumThreadCount,
081: int forumPostCount) throws CreateException,
082: DatabaseException, DuplicateKeyException,
083: ForeignKeyNotFoundException;
084:
085: public void delete(int forumID) throws DatabaseException,
086: ObjectNotFoundException;
087:
088: public void update(
089: int forumID, // primary key
090: int categoryID, String forumOwnerName, String forumName,
091: String forumDesc, Timestamp forumModifiedDate,
092: int forumOrder, int forumType, int forumFormatOption,
093: int forumOption, int forumStatus, int forumModerationMode)
094: throws ObjectNotFoundException, DatabaseException,
095: DuplicateKeyException, ForeignKeyNotFoundException;
096:
097: public void updateLastPostMemberName(int forumID, // primary key
098: String lastPostMemberName) throws ObjectNotFoundException,
099: DatabaseException, ForeignKeyNotFoundException;
100:
101: public void updateLastPostDate(int forumID, // primary key
102: Timestamp forumLastPostDate)
103: throws ObjectNotFoundException, DatabaseException;
104:
105: public void resetForumOwnerNameWhenDeleteMember(String memberName)
106: throws DatabaseException;
107:
108: public void updateStatistics(int forumID, // primary key
109: int forumThreadCount, int forumPostCount)
110: throws ObjectNotFoundException, DatabaseException;
111:
112: public void increasePostCount(int forumID)
113: throws DatabaseException, ObjectNotFoundException;
114:
115: public void increaseThreadCount(int forumID)
116: throws DatabaseException, ObjectNotFoundException;
117:
118: public void decreaseThreadCount(int forumID)
119: throws DatabaseException, ObjectNotFoundException;
120:
121: public ForumBean getForum(int forumID)
122: throws ObjectNotFoundException, DatabaseException;
123:
124: public Collection getForums() throws DatabaseException;
125:
126: public Collection getForums_inCategory(int categoryID)
127: throws DatabaseException;
128:
129: public Collection getForums_withSortSupport_limit(int offset,
130: int rowsToReturn, String sort, String order)
131: throws IllegalArgumentException, DatabaseException;
132:
133: public Collection getForums_withSortSupport_limit_ViewCount(
134: int offset, int rowsToReturn, String sort, String order)
135: throws IllegalArgumentException, DatabaseException;
136:
137: public void decreaseForumOrder(int forumID,
138: Timestamp forumModifiedDate) throws DatabaseException,
139: ObjectNotFoundException;
140:
141: public void increaseForumOrder(int forumID,
142: Timestamp forumModifiedDate) throws DatabaseException,
143: ObjectNotFoundException;
144: }
|