hibernate同一个更新操作为什么执行2次
我执行了一个更新操作,然后他执行了2遍sqlpublicbooleanupdateYhjbxx(Yhjbxxyhjbxx){//TODOAuto-generatedmet...
我执行了一个更新操作,然后他执行了2遍sql
public boolean updateYhjbxx(Yhjbxx yhjbxx) {
// TODO Auto-generated method stub
boolean b=true;
try {
UserInformation userinformation=this.userinformationdao.getUserinformation(yhjbxx.getYhid());
userinformation.setName(yhjbxx.getDlmc());
userinformation.setPassword(ToolUnit.decrypto(yhjbxx.getKl()));
//更新userinformation
this.userinformationdao.updateUserinformation(userinformation);
//更新用户基本信息表
this.yhjbxxdao.updateYhjbxx(yhjbxx);
} catch (Exception e) {
// TODO Auto-generated catch block
b=false;
e.printStackTrace();
}
return b;
}
这是执行更新的biz 展开
public boolean updateYhjbxx(Yhjbxx yhjbxx) {
// TODO Auto-generated method stub
boolean b=true;
try {
UserInformation userinformation=this.userinformationdao.getUserinformation(yhjbxx.getYhid());
userinformation.setName(yhjbxx.getDlmc());
userinformation.setPassword(ToolUnit.decrypto(yhjbxx.getKl()));
//更新userinformation
this.userinformationdao.updateUserinformation(userinformation);
//更新用户基本信息表
this.yhjbxxdao.updateYhjbxx(yhjbxx);
} catch (Exception e) {
// TODO Auto-generated catch block
b=false;
e.printStackTrace();
}
return b;
}
这是执行更新的biz 展开
展开全部
//更新userinformation
this.userinformationdao.updateUserinformation(userinformation);
//更新用户基本信息表
this.yhjbxxdao.updateYhjbxx(yhjbxx);
程序中也是执行两次啊
this.userinformationdao.updateUserinformation(userinformation);
//更新用户基本信息表
this.yhjbxxdao.updateYhjbxx(yhjbxx);
程序中也是执行两次啊
追问
是this.yhjbxxdao.updateYhjbxx(yhjbxx);执行了2次 上边那个因为没有变化数据,然后就没执行。。。我要问的就是为什么下边这个执行了2遍。上面那个没关系
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询