问答详情
源自:2-2 SSH-案例:登录功能代码实现

配置没有问题,登录的时候出错,后台提示这个错,如何解决

ERROR - Exception occurred during processing request: tb_staff is not mapped [from tb_staff where username=? and password=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: tb_staff is not mapped [from tb_staff where username=? and password=?]

提问者:曾许诺_殇 2016-11-09 16:14

个回答

  • 慕粉4348652
    2016-11-19 12:10:13
    已采纳

    from后面是实体名o(╯□╰)o

  • 慕粉4348652
    2016-11-19 12:01:09

    搞错,是from 后面 表名首字母大写或者是别的原因,反正我遇到同样问题是这样解决的

  • 慕粉4348652
    2016-11-19 11:35:49

    hql语句:from 表名,这里的表名是映射文件名

  • 曾许诺_殇
    2016-11-14 10:03:58

    值都对上了,但还是提示这个错误ERROR - Exception occurred during processing request: tb_staff is not mapped [from tb_staff where username=? and password=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: tb_staff is not mapped [from tb_staff where username=? and password=?]

  • lichen1391
    2016-11-11 09:25:43

    username和password的值对上了吗,都传递到hql语句中了吗