休眠MappingNotFoundException

时间:2018-08-01 19:48:27

标签: hibernate

    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
            "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

    <hibernate-mapping>
        <class name = "Employee" table = "EMPLOYEE">

            <meta attribute = "class-description">
                This class contains the employee detail.
            </meta>

            <id name = "id" type = "int" column = "id">
                <generator class="native"/>
            </id>

            <property name = "firstName" column = "first_name" type = "string"/>
            <property name = "lastName" column = "last_name" type = "string"/>
            <property name = "salary" column = "salary" type = "int"/>

        </class>
    </hibernate-mapping>

它与创建SessionFactory的Employee类和main类位于同一目录中。

它抛出此org.hibernate.MappingNotFoundException:资源:Employee.hbm.xml未找到异常。我怎样才能解决这个问题?谢谢

0 个答案:

没有答案