Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: Admins is not mapped [from Admins where adminname=:name and adminpwd=:pwd]等错误常见问题
1 Hql错误,
HQL是面向对象的查询语言
a、from 后接 类名,不是数据库表名,where 是类属性名,不是数据库字段名 注意区分大小写
![](https://img-blog.csdnimg.cn/20210508152151647.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0Rvd250,size_16,color_FFFFFF,t_70)
b、使用注解的注意把对应类注解为实体,
C、hibernat.hbm.xml 注意是否加载了对应包扫描或者xml配置
记录一下 错误!希望有所帮助!