NeQrhk 2016-10-30 14:07 采纳率: 30.6%
浏览 6485
已采纳

hql语句的问题,update同时set多个值,语句错误。

java.lang.IllegalArgumentException: node to traverse cannot be null!
tomcat报上面的错误

下面是我的hql语句,
String hql = "update Teacher t set t.tsex=? and t.ttelephone=? and t.teach_year=? and t.subject_One=? and t.teach_class_One=? where t.tusername=?";
Query sqlquery = ses.createQuery(hql);
sqlquery.setParameter(0, teacher.getTsex());
sqlquery.setParameter(1, teacher.getTtelephone());
sqlquery.setParameter(2, teacher.getTeach_year());
sqlquery.setParameter(3, sOne);
sqlquery.setParameter(4, cOne);
sqlquery.setParameter(5, nowLogin);

  • 写回答

4条回答 默认 最新

  • 请叫我七点起床 2016-10-31 02:43
    关注

    String hql = "update Teacher t set t.tsex=? , t.ttelephone=? , t.teach_year=? , t.subject_One=? , t.teach_class_One=? where t.tusername=?";

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵