第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

請求處理失敗;嵌套的異常是org.hibernate.QueryException:

請求處理失敗;嵌套的異常是org.hibernate.QueryException:

慕運(yùn)維8079593 2021-03-31 13:10:07
@Transactional@Modifyingpublic boolean deleteBook(String callno, String studentid) {    boolean userFounds= false;    Session session=this.sessionFactory.openSession();     System.out.println("check update:"+callno);     System.out.println("check update:"+studentid);        // delete operation    String SQL_QUERY2 ="delete from IssueBook where callno= ? and studentid=?";     Query query= session.createQuery(SQL_QUERY2);     query.setParameter(0, callno).executeUpdate();     query.setParameter(1, studentid).executeUpdate();     return userFounds;    }我在這里獲得500服務(wù)器異常query.setParameter(0,callno).executeUpdate(); query.setParameter(1,studentid).executeUpdate();請參閱stacktrace:
查看完整描述

1 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

String SQL_QUERY2 ="delete from IssueBook where callno=:callno and studentid=:studentid";

Query query= session.createQuery(SQL_QUERY2);

     query.setParameter(callno, callno);

     query.setParameter(studentid, studentid);

     return query.executeUpdate();

您的代碼中的問題是executeUpdate()應(yīng)該在設(shè)置所有參數(shù)后被調(diào)用一次。


查看完整回答
反對 回復(fù) 2021-04-21
  • 1 回答
  • 0 關(guān)注
  • 293 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號