org.hibernate.exception.DataException: 请高手帮忙
这个是错误
org.hibernate.exception.DataException: could not execute native bulk manipulation query
public void updategoods(int goodid,int count, double money,int pid,int sid) {
// TODO Auto-generated method stub
Session session=getHibernateTemplate().getSessionFactory().openSession();
Transaction tran=session.beginTransaction();
try{
Query right=session.createSQLQuery("update goodsinfo set g_count=g_count-"+count+",g_money=g_money-"+money+",p_id="+pid+",state=1 where g_id="+goodid);
right.executeUpdate();
Query right1=session.createSQLQuery("update enterinfo set e_money=e_money-"+money+" where s_id="+sid);
right1.executeUpdate();
Query right2=session.createSQLQuery("update outboundinfo set o_money="+money+" where s_id="+sid);
right2.executeUpdate();
Query right3=session.createSQLQuery("insert into outgoodsinfo values("+goodid+","+count+","+money+")");
right3.executeUpdate();
tran.commit();
}catch(Exception e){
e.printStackTrace();
}finally{
session.close();
}
}
就是因为我这样写所以报错