hibernate配置文件 error 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)*)".
错误原因:
标签顺序问题。
version标签要放在id之后,属性标签之前。如下边所示:
<version column="VERSION\_" name="version"></version>
<property column="CITY\_" name="city" not-null="false" type="string"/>
还没有评论,来说两句吧...