兄弟姐妹们啊,纠结很久的问题还是没有搞定
我hibernate执行一个更新的存储过程,但是总是最后一条数据无法更新。hibernate调用为:
daoA.getNamedQuery("Update_Agent_Product_Price")
.setLong(0, prod.getId())//.executeUpdate();
.list();存储过程:
ALTER PROCEDURE [dbo].[Update_Agent_Product_Price]
@productid numeric(18,0)
AS
BEGIN
select 0 update agentproductpriceinfo
set price=b.value2
from agentproductpriceinfo c
left join fieldinfo a on a.code = c.productid and a.name = c.unit
left join fieldvalueinfo b on a.id = b.fieldid
where a.code=@productid and ((a.value1='timeunits' and c.flag=1) or (a.value1='addtimeunits' and c.flag=2))
--where (a.code=1 and (a.value1='timeunits' and c.flag=1)) or (a.code=1 and (a.value1='addtimeunits' and c.flag=2))
END
我已经无奈了,大侠们帮帮忙吧
我hibernate执行一个更新的存储过程,但是总是最后一条数据无法更新。hibernate调用为:
daoA.getNamedQuery("Update_Agent_Product_Price")
.setLong(0, prod.getId())//.executeUpdate();
.list();存储过程:
ALTER PROCEDURE [dbo].[Update_Agent_Product_Price]
@productid numeric(18,0)
AS
BEGIN
select 0 update agentproductpriceinfo
set price=b.value2
from agentproductpriceinfo c
left join fieldinfo a on a.code = c.productid and a.name = c.unit
left join fieldvalueinfo b on a.id = b.fieldid
where a.code=@productid and ((a.value1='timeunits' and c.flag=1) or (a.value1='addtimeunits' and c.flag=2))
--where (a.code=1 and (a.value1='timeunits' and c.flag=1)) or (a.code=1 and (a.value1='addtimeunits' and c.flag=2))
END
我已经无奈了,大侠们帮帮忙吧
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货