hibernate 配制文件错误
时间:2008-06-19 11:29:20
来源:论坛整理 作者: 编辑:chinaitzhe
org.hibernate.MappingException: Repeated column in mapping for entity: com.pc.bean.Video column: resource_id (should be mapped with insert="false" update="false")
配制文件
<hibernate-mapping>
<class name="com.pc.bean.Resource" abstract="true" discriminator-value="RES" table="TBL_RESOURCE">
<id name="id" type="long" column="resource_id">
<meta attribute="scope-set">protected </meta>
<generator class="native"/>
</id>
<discriminator column="discriminator" type="string"/>
<many-to-one
name="rc"
class="com.pc.bean.ResourceContainer"
cascade="save-update">
<column name="resource_id"/>
</many-to-one>
<subclass name="com.pc.bean.Audio" discriminator-value="AD">
<property name="path" type="string" column="path" not-null="false"/>
<property name="len" type="int" column="len" not-null="false"/>
<property name="fileSize" column="file_size" type="int" />
</subclass>
<subclass name="com.pc.bean.Image" discriminator-value="IMG">
<property name="name" column="name" type="string"/>
<property name="path" column="path" type="string"/>
<property name="width" column="width" type="int"/>
<property name="height" column="height" type="int"/>
</subclass>
<subclass name="com.pc.bean.ResourceContainer" discriminator-value="RC">
<property name="title" column="title" type="string"/>
<property name="location" column="location" type="string"/>
<set
name="resources"
cascade="save-update"
inverse="true">
<key column="resource_id"> </key>
<one-to-many class="com.pc.bean.Resource"/>
</set>
</subclass>
</class>
</hibernate-mapping>
网友回复:各位高手,帮忙看看吧
网友回复:Repeated column in mapping for entity: com.pc.bean.Video column: resource_id
<id name="id" type="long" column="resource_id">
<meta attribute="scope-set">protected </meta>
<generator class="native"/>
</id>
<many-to-one
name="rc"
class="com.pc.bean.ResourceContainer"
cascade="save-update">
<column name="resource_id"/>
</many-to-one>
网友回复:自己把关联关系再理一理
网友回复:==,我有设计图,我发过来给大家看
网友回复:
网友回复:好了,,
关键字:hibernate,配制,文件,错误,
下一篇:下面没有链接了











文章评论
共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面