休眠映射xml有什么问题? [英] what is wrong with the hibernate mapping xml?

查看:67
本文介绍了休眠映射xml有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我验证以下xml时,出现以下错误:

As I validate the following xml, I get the following error :

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]


我得到这个的原因可能是什么?


What could be the reason I am getting this ?

 <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>

推荐答案

元素顺序错误.

discriminator放在id之后.

此处.

这篇关于休眠映射xml有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆