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 GroupsDAO { 53 54 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Groups"; 55 56 public static final String TUTOR_GROUP_NAME = "Tutor"; 58 public void findByPrimaryKey(int groupID) 59 throws ObjectNotFoundException, DatabaseException; 60 61 public void findByAlternateKey_GroupName(String groupName) 62 throws ObjectNotFoundException, DatabaseException; 63 64 public void create(String groupOwnerName, String groupName, 65 String groupDesc, int groupOption, Timestamp groupCreationDate, 66 Timestamp groupModifiedDate) 67 throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException; 68 69 public void delete(int groupID) 70 throws DatabaseException, ObjectNotFoundException; 71 72 public void update(int groupID, String groupName, String groupDesc, Timestamp groupModifiedDate) 74 throws ObjectNotFoundException, DatabaseException, DuplicateKeyException; 75 76 public void updateOwner(int groupID, String groupOwnerName, Timestamp groupModifiedDate) 78 throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException; 79 80 public GroupsBean getGroup(int groupID) 81 throws ObjectNotFoundException, DatabaseException; 82 83 public Collection getMyGroups(int memberID) 84 throws DatabaseException; 85 86 public Collection getGroups() 87 throws DatabaseException; 88 89 public int getNumberOfGroups() 91 throws AssertionException, DatabaseException; 92 93 public int getGroupIDFromGroupName(String groupName) 94 throws ObjectNotFoundException, DatabaseException; 95 96 } 97 | Popular Tags |