为了账号安全,请及时绑定邮箱和手机立即绑定

hibernate hql删除异常

hibernate hql删除异常

保守爱 2016-03-24 11:40:34
hql语句:dao.executeHql("delete Student As s where s.course.teacher.tno"=tno);错误信息:返回sql语句:delete from Per_Student cross join Per_COURSE course1_ where tno=12000002WARN: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cross join Per_COURSE course1_ where tno=12000002' at line 1student关联course,course关联teacher,我很好奇怎么delete时没有关联到teacher呢,这条hql语句应该是没有问题的吧?
查看完整描述

1 回答

?
badbomb

TA贡献16条经验 获得超10个赞

where s.course.teacher.tno"=tno

改为where s.course.teacher.tno="+tno

然后你试试

查看完整回答
反对 回复 2016-03-24
  • 保守爱
    保守爱
    不是这个问题,我在这里输错了的,程序中确实是这样..where s.course.teacher.tno="+tno
  • 1 回答
  • 0 关注
  • 3797 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信