1 40 package com.mvnforum.db; 41 42 import java.sql.Timestamp ; 43 import java.util.Collection ; 44 45 import net.myvietnam.mvncore.exception.AssertionException; 46 import net.myvietnam.mvncore.exception.CreateException; 47 import net.myvietnam.mvncore.exception.DatabaseException; 48 import net.myvietnam.mvncore.exception.ObjectNotFoundException; 49 import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException; 50 51 public interface ThreadDAO { 52 53 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Thread"; 54 55 public void findByPrimaryKey(int threadID) 56 throws ObjectNotFoundException, DatabaseException; 57 58 public int createThread(int forumID, String memberName, String lastPostMemberName, 59 String threadTopic, String threadBody, int threadVoteCount, 60 int threadVoteTotalStars, Timestamp threadCreationDate, Timestamp threadLastPostDate, 61 int threadType, int threadOption, int threadStatus, 62 int threadHasPoll, int threadViewCount, int threadReplyCount, 63 String threadIcon, int threadDuration, int threadAttachCount ) 64 throws ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException; 65 66 public void delete(int threadID) 67 throws DatabaseException, ObjectNotFoundException; 68 69 public void delete_inForum(int forumID) 70 throws DatabaseException; 71 72 public void updateForumID(int threadID, int forumID) 74 throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException; 75 76 public void updateThreadStatus(int threadID, int threadStatus) 78 throws ObjectNotFoundException, DatabaseException; 79 80 public void updateThreadType(int threadID, int threadType) 82 throws ObjectNotFoundException, DatabaseException; 83 84 public void updateTopic_Body_Icon(int threadID, String threadTopic, String threadBody, String threadIcon) 86 throws ObjectNotFoundException, DatabaseException; 87 88 public void increaseReplyCount(int threadID) 89 throws DatabaseException, ObjectNotFoundException; 90 91 public void updateLastPostMemberName(int threadID, String lastPostMemberName) 93 throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException; 94 95 public void updateLastPostDate(int threadID, Timestamp threadLastPostDate) 97 throws ObjectNotFoundException, DatabaseException; 98 99 public void updateThreadAttachCount(int threadID, 100 int count) 101 throws ObjectNotFoundException, DatabaseException; 102 103 public ThreadBean getThread(int threadID) 104 throws ObjectNotFoundException, DatabaseException; 105 106 public int getNumberOfEnableThreads_inForum(int forumID) 107 throws AssertionException, DatabaseException; 108 109 public int getNumberOfDisableThreads_inForum(int forumID) 110 throws AssertionException, DatabaseException; 111 112 public int getNumberOfNormalEnableThreads_inForum(int forumID) 113 throws AssertionException, DatabaseException; 114 115 public int getNumberOfEnableThreads() 116 throws AssertionException, DatabaseException; 117 118 public Collection getEnableThreads_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order) 119 throws IllegalArgumentException , DatabaseException; 120 121 public int getNumberOfDisableThreads() 122 throws AssertionException, DatabaseException; 123 124 public Collection getDisableBeans_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order) 125 throws IllegalArgumentException , DatabaseException; 126 127 public Collection getNormalEnableThreads_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order) 128 throws IllegalArgumentException , DatabaseException; 129 130 public Collection getAllEnableThreads_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order) 131 throws IllegalArgumentException , DatabaseException; 132 133 public Collection getDisableThreads_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order) 134 throws IllegalArgumentException , DatabaseException; 135 136 public Collection getThreads_inFavorite_inMember(int memberID) 138 throws DatabaseException; 139 140 public Collection getEnableStickies_inForum(int forumID) 141 throws DatabaseException; 142 143 public Collection getEnableForumAnnouncements_inForum(int forumID) 144 throws DatabaseException; 145 146 public Collection getEnableGlobalAnnouncements() 147 throws DatabaseException; 148 149 public void increaseViewCount(int threadID) 150 throws DatabaseException, ObjectNotFoundException; 151 152 public void updateReplyCount(int threadID, int threadReplyCount) 154 throws IllegalArgumentException , DatabaseException, ObjectNotFoundException; 155 156 public int getPreviousEnableThread(int forumID, int threadID) 157 throws DatabaseException, AssertionException; 158 159 public int getNextEnableThread(int forumID, int threadID) 160 throws DatabaseException, AssertionException; 161 162 public Collection getEnableThreads_inGlobal(Timestamp sinceDate) 163 throws DatabaseException; 164 165 public Collection getEnableThreads_inCategory(int categoryID, Timestamp sinceDate) 166 throws DatabaseException; 167 168 public Collection getEnableThreads_inForum(int forumID, Timestamp sinceDate) 169 throws DatabaseException; 170 171 public Collection getEnableThreads_inThread(int threadID, Timestamp sinceDate) 172 throws DatabaseException; 173 174 public int getNumberOfEnableThreadsWithPendingPosts() 175 throws AssertionException, DatabaseException; 176 177 public int getNumberOfEnableThreadsWithPendingPosts_inForum(int forumID) 178 throws AssertionException, DatabaseException; 179 180 193 public Collection getEnableThreadsWithPendingPosts_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order) 194 throws IllegalArgumentException , DatabaseException, ObjectNotFoundException; 195 196 public Collection getEnableThreadsWithPendingPosts_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order) 197 throws IllegalArgumentException , DatabaseException, ObjectNotFoundException; 198 199 } 200 | Popular Tags |