gpt4 book ai didi

java - hibernate映射xml有什么问题?

转载 作者:行者123 更新时间:2023-12-01 14:28:30 31 4
gpt4 key购买 nike

当我验证以下 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*,resultset*,
(query|sql-query)*)". [16]
<小时/>

我收到此消息的原因可能是什么?

 <hibernate-mapping>
<class name="pojo.Parent" table="student_detail">
<id name="roll_number">
<generator class="increment" />
</id>
<property name="s_name" />
<discriminator column="discrim" type="string" />
<subclass name="pojo.Child">
<property name="hindi" />
<property name="english" />
<property name="punjabi" />
<property name="total" />
</subclass>
</class>
</hibernate-mapping>

最佳答案

元素的顺序错误。

鉴别器放在id之后。

看一下示例 here .

关于java - hibernate映射xml有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16997878/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com