1 40 package com.mvnforum.db; 41 42 import java.sql.Timestamp ; 43 import java.util.Collection ; 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 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 forumName, int categoryID) 59 throws ObjectNotFoundException, DatabaseException; 60 61 public void create(int categoryID, String lastPostMemberName, String forumName, 62 String forumDesc, Timestamp forumCreationDate, Timestamp forumModifiedDate, 63 Timestamp forumLastPostDate, int forumOrder, int forumType, 64 int forumFormatOption, int forumOption, int forumStatus, 65 int forumModerationMode, String forumPassword, int forumThreadCount, 66 int forumPostCount) 67 throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException; 68 69 public int createForum(int categoryID, String lastPostMemberName, String forumName, 70 String forumDesc, Timestamp forumCreationDate, Timestamp forumModifiedDate, 71 Timestamp forumLastPostDate, int forumOrder, int forumType, 72 int forumFormatOption, int forumOption, int forumStatus, 73 int forumModerationMode, String 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, int categoryID, String forumName, String forumDesc, 82 Timestamp 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, String lastPostMemberName) 89 throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException; 90 91 public void updateLastPostDate(int forumID, Timestamp forumLastPostDate) 93 throws ObjectNotFoundException, DatabaseException; 94 95 public void updateStatistics(int forumID, 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 getForums() 112 throws DatabaseException; 113 114 public Collection getForums_inCategory(int categoryID) 115 throws DatabaseException; 116 117 public void decreaseForumOrder(int forumID, Timestamp forumModifiedDate) 118 throws DatabaseException, ObjectNotFoundException; 119 120 public void increaseForumOrder(int forumID, Timestamp forumModifiedDate) 121 throws DatabaseException, ObjectNotFoundException; 122 } 123 | Popular Tags |