org.hibernate.hql.ast.QuerySyntaxException is not mapped

我用Hibernate实现一个教师的登陆过程,当我在JSP的登陆页面输入姓名和密码,点登陆后,显示登陆失败页,在服务器里显示如下的错误信息:
    org.hibernate.hql.ast.QuerySyntaxException: teachers is not mapped. [from teache
rs tea where tea.name=:teaName and tea.password=:teaPassword]
HQL错了
因为Hibernate是对类查询的
在hql="from teachers tea where tea.name=:teaName and tea.password=:teaPassword";中,
teachers是数据库中的表,而teachers对应的类是Teachers.java,现在只需要将teachers改为Teachers就可以了,即
hql="from Teachers tea where tea.name=:teaName and tea.password=:teaPassword";
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页