"table" is not mapped 解决方法

现象:
使用hql="from person" 出现" person is not mapped " 错误

配置文件如下:
<hibernate-mapping>
    <class name="src.Person"
           table="person">
        <id name="name"/>
       
        <property name="password"/>
    </class>
</hibernate-mapping>


原因:

hql是写的是PO对象,不是table名

故改为配置文件中的红色部分的类名即可。

原文地址:https://www.cnblogs.com/mandalaluo/p/3811221.html