Users is not mapped(Hibernate实体类采用注解)

 今天做简单的登陆验证web应用时,用HQL语句查询数据表时

总是出现Users is not mapped [from Users u where u.username=? and u.password=? ]错误;

后面在HQL语句上把数据库表映射的实体类加上包名 (形如yii.entity.Users);

查询成功

原文地址:https://www.cnblogs.com/eternalisland/p/5496805.html