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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

hibernate5.3版本出现hibernate中The server time zone value“乱码”问题的解决办法。

关于An association from the table refers to an unmapped class

13.org.hibernate.TransientObjectException:The given object has a null identifier:com.you.model.UserI

Download the Hibernate Tools

Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法(示例代码

hibernate配置管理