dao管理
1:?? 编写一个 DaoFacade? 类管理所有的Dao
?
public class DaoFacade {
?private CommonDao commonDao;
?private FbcmCeditAppDao fbcmCeditAppDao;
??
?public CommonDao getCommonDao() {
??return commonDao;
?}
?public void setCommonDao(CommonDao commonDao) {
??this.commonDao = commonDao;
?}
?public FbcmCeditGetInfoDao getFbcmCeditGetInfoDao() {
??return fbcmCeditGetInfoDao;
?}
?public void setFbcmCeditGetInfoDao(FbcmCeditGetInfoDao fbcmCeditGetInfoDao) {
??this.fbcmCeditGetInfoDao = fbcmCeditGetInfoDao;
?}
}
?
2: * Title:所有Server的父类
?
public class BaseServerImpl {
?private DaoFacade daoFacade;
?
? public DaoFacade getDaoFacade() {
??return daoFacade;
?}
?public void setDaoFacade(DaoFacade daoFacade) {
??this.daoFacade = daoFacade;
?}
?
?
?
?
}
?
3:server实现类
?
public class FbcmCeditGetInfoServerImpl extends BaseServerImpl {
?
?public List getCltInfoToList() {
??return getDaoFacade().getFbcmCeditGetInfoDao().getCltCltInfoToList();
?}
?
}
?
}
?
注释:每一个dao都是继承baseDao
?
baseDao在前几篇中有介绍。