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 AttachmentDAO { 52 53 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Attachment"; 54 55 public void create(int postID, int memberID, String attachFilename, 56 int attachFileSize, String attachMimeType, String attachDesc, 57 String attachCreationIP, Timestamp attachCreationDate, Timestamp attachModifiedDate, 58 int attachDownloadCount, int attachOption, int attachStatus) 59 throws CreateException, DatabaseException, ForeignKeyNotFoundException; 60 61 public int createAttachment(int postID, int memberID, String attachFilename, 62 int attachFileSize, String attachMimeType, String attachDesc, 63 String attachCreationIP, Timestamp attachCreationDate, Timestamp attachModifiedDate, 64 int attachDownloadCount, int attachOption, int attachStatus) 65 throws CreateException, DatabaseException, ForeignKeyNotFoundException, ObjectNotFoundException; 66 67 public void delete(int attachID) 68 throws DatabaseException, ObjectNotFoundException; 69 70 public AttachmentBean getAttachment(int attachID) 71 throws ObjectNotFoundException, DatabaseException; 72 73 public Collection getAttachments() 75 throws DatabaseException; 76 77 public int getNumberOfAttachments() 78 throws AssertionException, DatabaseException; 79 80 public int getNumberOfAttachments_inPost(int postID) 81 throws AssertionException, DatabaseException; 82 83 public int getNumberOfAttachments_inThread(int threadID) 84 throws AssertionException, DatabaseException; 85 86 public void delete_inPost(int postID) 87 throws DatabaseException; 88 89 public Collection getAttachments_inPost(int postID) 90 throws DatabaseException; 91 92 public Collection getAttachments_inThread(int threadID) 93 throws DatabaseException; 94 95 public Collection getAttachments_inForum(int forumID) 96 throws DatabaseException; 97 98 public void increaseDownloadCount(int attachID) 99 throws DatabaseException, ObjectNotFoundException; 100 101 public void updateAttachDesc(int attachID, String newDesc) 102 throws DatabaseException, ObjectNotFoundException; 103 104 public void updateAttachOption(int attachID, int attachOption) 105 throws DatabaseException, ObjectNotFoundException; 106 } 107 | Popular Tags |