1 41 package com.mvnforum.db; 42 43 import java.sql.Timestamp ; 44 import java.util.Collection ; 45 46 import net.myvietnam.mvncore.exception.AssertionException; 47 import net.myvietnam.mvncore.exception.CreateException; 48 import net.myvietnam.mvncore.exception.DatabaseException; 49 import net.myvietnam.mvncore.exception.DuplicateKeyException; 50 import net.myvietnam.mvncore.exception.ObjectNotFoundException; 51 import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException; 52 53 public interface CompanyDAO { 54 55 public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Company"; 56 57 public void findByPrimaryKey(int companyID) 58 throws ObjectNotFoundException, DatabaseException; 59 60 public void findByAlternateKey_GroupID(int groupID) 61 throws ObjectNotFoundException, DatabaseException; 62 63 public void findByAlternateKey_CompanyName(String companyName) 64 throws ObjectNotFoundException, DatabaseException; 65 66 public void findByAlternateKey_CompanyEmail(String companyEmail) 67 throws ObjectNotFoundException, DatabaseException; 68 69 public void findByAlternateKey_CompanySpaceName(String companySpaceName) 70 throws ObjectNotFoundException, DatabaseException; 71 72 public void create(int groupID, String companyName, String companyAddress, 73 String companyCity, String companyCAP, String companyProvince, 74 String companyRegion, String companyPhone, String companyFax, 75 String companyWebsite, String companyEmail, String companySpaceName, 76 String companySpaceHeader, String companySpaceFooter, String companyVATNumber, 77 String companyLogo, String companyCss, Timestamp companyCreationDate, 78 Timestamp companyModifiedDate) 79 throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException; 80 81 public void delete(int companyID) 82 throws ObjectNotFoundException, DatabaseException; 83 84 public void updateCompanyInfo(int companyID, String companyName, String companyAddress, String companyCity, 86 String companyCAP, String companyProvince, String companyRegion, 87 String companyPhone, String companyFax, String companyWebsite, 88 String companyEmail, String companySpaceName, String companySpaceHeader, 89 String companySpaceFooter, String companyVATNumber, Timestamp companyModifiedDate) 90 throws ObjectNotFoundException, DatabaseException, DuplicateKeyException; 91 92 public void updateCompanyLogo(int companyID, String virtualFile) 93 throws ObjectNotFoundException, DatabaseException; 94 95 public void updateCompanyCss(int companyID, String virtualFile) 96 throws ObjectNotFoundException, DatabaseException; 97 98 public int getCompanyIDFromGroupID(int groupID) 99 throws ObjectNotFoundException, DatabaseException; 100 101 102 public int getCompanyIDFromCompanyEmail(String companyEmail) 103 throws ObjectNotFoundException, DatabaseException; 104 105 public int getCompanyIDFromCompanySpaceName(String companySpaceName) 106 throws ObjectNotFoundException, DatabaseException; 107 108 public int getCompanyIDFromCompanyCreationDate(java.util.Date companyCreationDate) 110 throws ObjectNotFoundException, DatabaseException; 111 112 public CompanyBean getCompany(int companyID) 113 throws ObjectNotFoundException, DatabaseException; 114 115 public Collection getCompanies_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order) 116 throws IllegalArgumentException , DatabaseException; 117 118 public int getNumberOfCompanies() 119 throws AssertionException, DatabaseException; 120 121 127 public Collection getCompanies() 128 throws DatabaseException; 129 130 } | Popular Tags |