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 PostDAO { 52 53 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Post"; 54 55 public void findByPrimaryKey(int postID) 56 throws ObjectNotFoundException, DatabaseException; 57 58 public int createPost(int parentPostID, int forumID, int threadID, 59 int memberID, String memberName, String lastEditMemberName, 60 String postTopic, String postBody, Timestamp postCreationDate, 61 Timestamp postLastEditDate, String postCreationIP, String postLastEditIP, 62 int postEditCount, int postFormatOption, int postOption, 63 int postStatus, String postIcon, int postAttachCount) 64 throws CreateException, DatabaseException, ForeignKeyNotFoundException; 65 66 public void delete(int postID) 67 throws DatabaseException, ObjectNotFoundException; 68 69 public void delete_inThread(int threadID) 70 throws DatabaseException; 71 72 public void delete_inForum(int forumID) 73 throws DatabaseException; 74 75 public void update(int postID, String lastEditMemberName, String postTopic, String postBody, 77 Timestamp postLastEditDate, String postLastEditIP, int postFormatOption, 78 int postOption, int postStatus, String postIcon) 79 throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException; 80 81 public void updateAttachCount(int postID, int postAttachCount) 83 throws ObjectNotFoundException, DatabaseException; 84 85 public void updateStatus(int postID, int postStatus) 87 throws ObjectNotFoundException, DatabaseException; 88 89 public void update_ForumID_inThread(int threadID, int forumID) 90 throws DatabaseException, ForeignKeyNotFoundException; 91 92 public void updateParentPostID(int oldParentPostID, int newParentPostID) 93 throws ObjectNotFoundException, DatabaseException; 94 95 public void increaseEditCount(int postID) 96 throws DatabaseException, ObjectNotFoundException; 97 98 public PostBean getPost(int postID) 99 throws ObjectNotFoundException, DatabaseException; 100 101 109 public PostBean getFirstPost_inThread(int threadID) 110 throws ObjectNotFoundException, DatabaseException; 111 112 public Collection getEnablePosts_inThread_limit(int threadID, int offset, int rowsToReturn) 113 throws IllegalArgumentException , DatabaseException; 114 115 public Collection getDisablePosts_inThread_limit(int threadID, int offset, int rowsToReturn) 116 throws IllegalArgumentException , DatabaseException; 117 118 public int getNumberOfEnablePosts_inThread(int threadID) 119 throws AssertionException, DatabaseException; 120 121 public int getNumberOfDisablePosts_inThread(int threadID) 122 throws AssertionException, DatabaseException; 123 124 public int getNumberOfPosts_inMember(int memberID) 125 throws AssertionException, DatabaseException; 126 127 135 public int getNumberOfEnablePosts_inForum(int forumID) 136 throws AssertionException, DatabaseException; 137 138 public int getNumberOfDisablePosts_inForum(int forumID) 139 throws AssertionException, DatabaseException; 140 141 148 public int getNumberOfPosts() throws AssertionException, DatabaseException; 149 150 156 public Collection getPosts() throws DatabaseException; 157 158 public int getMaxPostID() 159 throws AssertionException, DatabaseException; 160 161 167 public Collection getPosts_fromIDRange(int fromID, int toID) 168 throws IllegalArgumentException , DatabaseException; 169 170 181 public Collection getLastEnablePosts_inThread_limit(int threadID, int rowsToReturn) 182 throws IllegalArgumentException , DatabaseException; 183 184 194 public Collection getLastEnablePosts_inForum_limit(int forumID, int rowsToReturn) 195 throws IllegalArgumentException , DatabaseException; 196 197 public Collection getMostActiveMembers(Timestamp since, int rowsToReturn) 198 throws DatabaseException; 199 200 public Collection getMostActiveThreads(Timestamp since, int rowsToReturn) 201 throws DatabaseException; 202 } 203 | Popular Tags |