底层方法调用
publicList
List
returnlist.size()>0?
list:
null;
}
publicAccountqueryById(intid){
Accountaccount=accountDAO.findById(id);
returnaccount!
=null?
account:
null;
}
publicbooleanupdate(Accountaccount){
booleanflag=false;
try{
accountDAO.attachDirty(account);
flag=true;
}catch(Exceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}
returnflag;
}
publicbooleanupdateAccountBO(intaccountId,StringuserName,StringuserPwd){
Accountaccount=newAccount();
account.setAccountId(accountId);
account.setAccountName(userName);
account.setAccountPwd(userPwd);
returnaccountDAOImpl.update(account);
}
publicbooleandelete(intid){
booleanflag=false;
try{
Accountaccount=this.queryById(id);
accountDAO.delete(account);
flag=true;
}catch(Exceptione){
e.printStackTrace();
}
returnflag;
}
publicbooleanadd(StringuserName,StringuserPwd){
booleanflag=false;
try{
Accountaccount=newAccount();
account.setAccountName(userName);
account.setAccountPwd(userPwd);
accountDAO.save(account);
flag=true;
}catch(Exceptione){
e.printStackTrace();
}
returnflag;
}
Web.xml
--以classpath方式加载配置文件-->
/WEB-INF/applicationContext.xml
--以listener方式加载-->
--dwr-->
DWR.xml
Application.xml
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> hibernate.cfg.xml"> copyright@ 2008-2022 冰豆网网站版权所有 经营许可证编号:鄂ICP备2022015515号-1