Exception in thread "main" org.hibernate.MappingException: Unsupported cascade style: save_update
来源:百度知道 编辑:UC知道 时间:2024/06/04 01:25:26
当运行测试类往数据库里添加数据的时候出现这个异常,Exception in thread "main" org.hibernate.MappingException: Unsupported cascade style: save_update 是哪里出错啊!
<hibernate-mapping package="cn.dawning.model">
<class name="Topic" table="t_topic">
<id name="id">
<generator class="uuid"/>
</id>
<property name="title"/>
<property name="content"/>
<property name="submitTime" type="date"/>
<property name="pointNum" type="long"/>
<!-- 一个用户可以有个论题 -->
<many-to-one name="userId" class="User" column="user_id" cascade="save-update" />
<!-- 一个论区可以有多个论题 -->
<many-to-one name="discId" class="DiscussArea" column="disc_id" cascade="save-upda
<hibernate-mapping package="cn.dawning.model">
<class name="Topic" table="t_topic">
<id name="id">
<generator class="uuid"/>
</id>
<property name="title"/>
<property name="content"/>
<property name="submitTime" type="date"/>
<property name="pointNum" type="long"/>
<!-- 一个用户可以有个论题 -->
<many-to-one name="userId" class="User" column="user_id" cascade="save-update" />
<!-- 一个论区可以有多个论题 -->
<many-to-one name="discId" class="DiscussArea" column="disc_id" cascade="save-upda
我只知道如果是做反向工程的时候选择了关联性,容易带来这种错误。
没有看到你的xml定义,不能确定是哪种关联引起的。
如果不是一定要保持这种关联,或者说愿意用程序去控制表与表之间的关联约束的话。
在做反向工程的时候,可以将那些选项全部不选:(myeclipse的hibernate插件)
体现在所定义的表的xml中,就是形如以下样式的东西不要了:
<!-- tbRole 与 Role 映射关系 -->
<class name="lhpkg.model.Role" table="tbRole" schema="dbo" catalog="db_oswf">
<id name="id" type="java.lang.Long">
<column name="ID" />
<generator class="increment" />
</id>
<property name="name" 
Exception EOleSysError in module
英语作文,主题:in th park
Realistic novel in the 18th century
on June 5th和in June
Christmas in the 13th Month
nothing in thé world 是什么意思?
Report ranks China 6th in overall strength 怎么翻译?
谁能告诉我feminism in 17th century 在英国
The film was released on 11th July in China
Fashions in America before the 19th century_____those of Egland.