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.DuplicateKeyException; 49 import net.myvietnam.mvncore.exception.ObjectNotFoundException; 50 import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException; 51 52 public interface WatchDAO { 53 54 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Watch"; 55 56 public void findByPrimaryKey(int watchID) 57 throws ObjectNotFoundException, DatabaseException; 58 59 public void findByAlternateKey_MemberID_CategoryID_ForumID_ThreadID(int memberID, int categoryID, int forumID, int threadID) 60 throws ObjectNotFoundException, DatabaseException; 61 62 public void create(int memberID, int categoryID, int forumID, 63 int threadID, int watchType, int watchOption, 64 int watchStatus, Timestamp watchCreationDate, Timestamp watchLastSentDate, 65 Timestamp watchEndDate) 66 throws IllegalArgumentException , CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException; 67 68 public void delete(int watchID) 69 throws DatabaseException, ObjectNotFoundException; 70 71 public void delete_inMember(int memberID) 72 throws DatabaseException; 73 74 public void delete_inCategory(int categoryID) 75 throws DatabaseException; 76 77 public void delete_inForum(int forumID) 78 throws DatabaseException; 79 80 public void delete_inThread(int threadID) 81 throws DatabaseException; 82 83 public void updateLastSentDate(int watchID, Timestamp watchLastSentDate) 85 throws ObjectNotFoundException, DatabaseException; 86 87 public WatchBean getWatch(int watchID) 88 throws ObjectNotFoundException, DatabaseException; 89 90 public WatchBean getWatch_byAlternateKey_MemberID_CategoryID_ForumID_ThreadID(int memberID, int categoryID, int forumID, int threadID) 92 throws ObjectNotFoundException, DatabaseException; 93 94 public Collection getWatches() 96 throws DatabaseException; 97 98 public int getNumberOfWatches() 100 throws AssertionException, DatabaseException; 101 102 public int getNumberOfWatches_forMember(int memberID) 103 throws AssertionException, DatabaseException; 104 105 public Collection getMemberBeans() 107 throws DatabaseException; 108 109 public Collection getWatches_forMember(int memberID) 111 throws DatabaseException; 112 113 public void updateLastSentDate_forMember(int memberID, Timestamp watchLastSentDate) 115 throws ObjectNotFoundException, DatabaseException; 116 117 } 118 | Popular Tags |