首页 > 代码库 > DTD

DTD

在写**.hbm.xml文件时,IDEA 给我报错

 

     

<class name="Image" table="t_image" >
<id name="imageId" column="imageId" type="java.lang.Long">
<generator class="native"></generator>
</id>

<property name="imageName" column="imageName" type="java.lang.String" length="30"/>
<property name="imageUploadDate" column="imageUploadDate" type="java.util.Date"/>
<many-to-one name="user" column="userId" class="party.infoo.model.User"></many-to-one>

     <discriminator  column="imageType" type="java.lang.String"/>
<subclass name="party.infoo.model.WorkImage"  discriminator-value="http://www.mamicode.com/WorkImage"/>
<subclass name="party.infoo.model.LifeImage" discriminator-value="http://www.mamicode.com/LifeImage"/>
</class>

查看了一下DTD源文件,发现
<discriminator  column="imageType" type="java.lang.String"/>   不是写在这里的     

顺序应该放在 应该在前面

<!ELEMENT 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*,
resultset*,
(query|sql-query)*
)>

必须按照 , 隔开的顺序来写呀

DTD