hibernate hql删除异常

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=12000002

WARN: 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 1

student关联course,course关联teacher,我很好奇怎么delete时没有关联到teacher呢,这条hql语句应该是没有问题的吧?



保守爱
浏览 3823回答 1
1回答

badbomb

where s.course.teacher.tno"=tno改为where s.course.teacher.tno="+tno然后你试试
打开App,查看更多内容
随时随地看视频慕课网APP