1 40 package com.mvnforum.db; 41 42 import java.sql.Timestamp ; 43 import java.util.Collection ; 44 45 import net.myvietnam.mvncore.exception.CreateException; 46 import net.myvietnam.mvncore.exception.DatabaseException; 47 import net.myvietnam.mvncore.exception.DuplicateKeyException; 48 import net.myvietnam.mvncore.exception.ObjectNotFoundException; 49 import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException; 50 51 public interface CategoryDAO { 52 53 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Category"; 54 55 public void findByPrimaryKey(int categoryID) 56 throws ObjectNotFoundException, DatabaseException; 57 58 public void findByAlternateKey_CategoryName(String categoryName) 59 throws ObjectNotFoundException, DatabaseException; 60 61 public void create(int parentCategoryID, String categoryName, String categoryDesc, 62 Timestamp categoryCreationDate, Timestamp categoryModifiedDate, int categoryOrder, 63 int categoryOption, int categoryStatus) 64 throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException; 65 66 public void delete(int categoryID) 67 throws DatabaseException, ObjectNotFoundException; 68 69 public void update(int categoryID, String categoryName, String categoryDesc, Timestamp categoryModifiedDate, 71 int categoryOrder, int categoryOption, int categoryStatus) 72 throws ObjectNotFoundException, DatabaseException, DuplicateKeyException; 73 74 public CategoryBean getCategory(int categoryID) 75 throws ObjectNotFoundException, DatabaseException; 76 77 public Collection getCategories() 78 throws DatabaseException; 79 80 public void decreaseCategoryOrder(int categoryID, Timestamp categoryModifiedDate) 81 throws DatabaseException, ObjectNotFoundException; 82 83 public void increaseCategoryOrder(int categoryID, Timestamp categoryModifiedDate) 84 throws DatabaseException, ObjectNotFoundException; 85 86 } 87 | Popular Tags |