hibernate 错误集合

1.org.hibernate.hql.ast.QuerySyntaxException is not mapped
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";

本文来自CSDN博客:http://blog.csdn.net/zxq1406spys/archive/2008/09/04/2881258.aspx

你可能感兴趣的:(Hibernate,数据库)