问题描述
- 菜鸟问一个hibernate关于继承关系映射的配置问题
-
按照教学视频配置:<class name="Employee" discriminator-value = "0"> <id name="id"> <generator class="native"></generator> </id> <property name="name"/> <discriminator column = "type" type = "int"/> <many-to-one name="department" column = "depart_id"></many-to-one> <subclass name = "Skiller" discriminator-value = "1" > <property name = "skill"/> </subclass> <subclass name = "Sales" discriminator-value = "2" > <property name = "sell"/> </subclass> </class>
加了一个配置了subclass之后,就报错
元素类型为 "class" 的内容必须匹配 "(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)*)"。
按照官网上修改还是一样报错
不知道哪错了刚接触hibernate,比较菜,希望各位大神不吝赐教
时间: 2025-01-01 08:41:37