HIbernate错误 - org.xml.sax.SAXParseException:元素类型“class”的内容必须匹配

时间:2016-11-29 04:49:20

标签: java hibernate hibernate-mapping

下面的

是hbm.xml

<class name="Location" table="LOCATION">
    <cache usage="read-only" />

    <id name="location_cd" column="LOCATION_CD" />

    <property name="location_type_cd" column="LOCATION_TYPE_CD"  not-null="true" />
    <property name="organization_id" column="ORGANIZATION_ID" not-null="true"/>
    <property name="census_ind" column="CENSUS_IND"/>



</class>

任何人都可以帮助理解为什么会出现此错误吗?

1 个答案:

答案 0 :(得分:0)

我认为缺少列的类型

你应该改变这个

<id name="id" column="LOCATION_CD" type="int"></id>

or

 <id name="location_cd" column="LOCATION_CD" type="int" />
相关问题