首页 > 代码库 > hibernate配置文件 The content of element type "class" must match

hibernate配置文件 The content of element type "class" must match

hibernate映射文件hbm.xml出错,错误信息如下:

The content of element type "class" must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,
(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|
any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-
subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,fetch-profile*,resultset*,(query|sql-query)*)".

 

改正方法:

class标签内缺少ID属性,加上下面内容即可:

<id name="id" type="java.lang.Integer">
    <column name="ID" />
    <generator class="native" />
</id>

hibernate配置文件 The content of element type "class" must match