KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mvnforum > db > ForumDAO


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/ForumDAO.java,v 1.8 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.8 $
5  * $Date: 2006/04/14 17:05:26 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  */

40 package com.mvnforum.db;
41
42 import java.sql.Timestamp JavaDoc;
43 import java.util.Collection JavaDoc;
44
45 import net.myvietnam.mvncore.exception.CreateException;
46 import net.myvietnam.mvncore.exception.DatabaseException;
47 import net.myvietnam.mvncore.exception.DuplicateKeyException;
48 import net.myvietnam.mvncore.exception.ObjectNotFoundException;
49 import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException;
50
51 public interface ForumDAO {
52
53     public static final String JavaDoc TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Forum";
54
55     public void findByPrimaryKey(int forumID)
56         throws ObjectNotFoundException, DatabaseException;
57
58     public void findByAlternateKey_ForumName_CategoryID(String JavaDoc forumName, int categoryID)
59         throws ObjectNotFoundException, DatabaseException;
60
61     public void create(int categoryID, String JavaDoc lastPostMemberName, String JavaDoc forumName,
62                        String JavaDoc forumDesc, Timestamp JavaDoc forumCreationDate, Timestamp JavaDoc forumModifiedDate,
63                        Timestamp JavaDoc forumLastPostDate, int forumOrder, int forumType,
64                        int forumFormatOption, int forumOption, int forumStatus,
65                        int forumModerationMode, String JavaDoc forumPassword, int forumThreadCount,
66                        int forumPostCount)
67         throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException;
68
69     public int createForum(int categoryID, String JavaDoc lastPostMemberName, String JavaDoc forumName,
70                         String JavaDoc forumDesc, Timestamp JavaDoc forumCreationDate, Timestamp JavaDoc forumModifiedDate,
71                         Timestamp JavaDoc forumLastPostDate, int forumOrder, int forumType,
72                         int forumFormatOption, int forumOption, int forumStatus,
73                         int forumModerationMode, String JavaDoc forumPassword, int forumThreadCount,
74                         int forumPostCount)
75         throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException;
76
77     public void delete(int forumID)
78         throws DatabaseException, ObjectNotFoundException;
79
80     public void update(int forumID, // primary key
81
int categoryID, String JavaDoc forumName, String JavaDoc forumDesc,
82                        Timestamp JavaDoc forumModifiedDate, int forumOrder, int forumType,
83                        int forumFormatOption, int forumOption, int forumStatus,
84                        int forumModerationMode)
85         throws ObjectNotFoundException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException;
86
87     public void updateLastPostMemberName(int forumID, // primary key
88
String JavaDoc lastPostMemberName)
89         throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException;
90
91     public void updateLastPostDate(int forumID, // primary key
92
Timestamp JavaDoc forumLastPostDate)
93         throws ObjectNotFoundException, DatabaseException;
94
95     public void updateStatistics(int forumID, // primary key
96
int forumThreadCount, int forumPostCount)
97         throws ObjectNotFoundException, DatabaseException;
98
99     public void increasePostCount(int forumID)
100         throws DatabaseException, ObjectNotFoundException;
101
102     public void increaseThreadCount(int forumID)
103         throws DatabaseException, ObjectNotFoundException;
104
105     public void decreaseThreadCount(int forumID)
106         throws DatabaseException, ObjectNotFoundException;
107
108     public ForumBean getForum(int forumID)
109         throws ObjectNotFoundException, DatabaseException;
110
111     public Collection JavaDoc getForums()
112         throws DatabaseException;
113
114     public Collection JavaDoc getForums_inCategory(int categoryID)
115         throws DatabaseException;
116
117     public void decreaseForumOrder(int forumID, Timestamp JavaDoc forumModifiedDate)
118         throws DatabaseException, ObjectNotFoundException;
119
120     public void increaseForumOrder(int forumID, Timestamp JavaDoc forumModifiedDate)
121         throws DatabaseException, ObjectNotFoundException;
122 }
123
Popular Tags