Hibernate级联删除时:Cannot delete or update a parent row: a foreign key constraint fails异常
在删除主表数据时,报了一个异常
Cannot delete or update a parent row: a foreign key constraint fails
原因是主表中还包含字表的数据,不能删除与这张表或数据有关联的字段,所以无法删除
解决办法:在创建数据库的外键时,将删除的动作配置由RESTRICT改成cascade,就可以解决.
Hibernate级联删除时:Cannot delete or update a parent row: a foreign key constraint fails异常的更多相关文章
- 【转】表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
转载地址:http://lijiejava.iteye.com/blog/790478 有两张表,结构如下: t_item: t_bid: id ...
- 表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
有两张表,结构如下: t_item: t_bid: id int id int n ...
- Mysql - 删除表时出现: Cannot delete or update a parent row: a foreign key constraint fails
现象 MySQL在删除一张表时出现 ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint ...
- mysql删除有外链索引数据,Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法
mysql删除有外链索引数据Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法查询:DELETE ...
- mysql 在删除数据出现Cannot delete or update a parent row: a foreign key constraint fails 这个该如何解决
mysql 在删除数据出现Cannot delete or update a parent row: a foreign key constraint fails 这个该如何解决 可以这样解决: S ...
- MySQL:ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
MySQL在删除一张表时出现 ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fa ...
- Mysql之1451 - Cannot delete or update a parent row: a foreign key constraint fails...解决办法记录
今天使用delete语句删除一张表中的一条信息时,提示了这么一个错误:1451 - Cannot delete or update a parent row: a foreign key constr ...
- ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
mysql 删除表时提示有外键 mysql> drop tables auth_group;ERROR 1217 (23000): Cannot delete or update a paren ...
- MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 错误
前几天,发现从库挂了,具体报错信息如下: 分析思路 1. 因为我采用的是选择性复制,只针对以下几个库进行复制: card,upay,deal,monitor,collect.所以,不太可能出现对于sa ...
随机推荐
- ERR: Call to undefined function openssl_random_pseudo_bytes()
最近使用TP5/PHP7,总是出现ERR: Call to undefined function index\index\openssl_random_pseudo_bytes(),才发现是php没有 ...
- 【PHP操作sphinx】
[index.php] [find.php] <?php header("Content-type:text/html;charset=utf-8"); $keyword = ...
- POJ 2192 :Zipper(DP)
http://poj.org/problem?id=2192 Zipper Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1 ...
- awk 手册--【转载】
1. 前言 有关本手册 : 这是一本awk学习指引, 其重点着重于 : l awk 适于解决哪些问题 ? l awk 常见的解题模式为何 ? 为使读者快速掌握awk解 ...
- 算法心得1:由$nlogn$复杂度的LIS算法引起的思考
LIS(Longest Increasing Subsequence)是一类典型的动态规划类问题,简化描述如下: 给定$N(n) = \{1,2...,n\}$的一个排列$P(n)$,求$P(n)$中 ...
- Ramsey theorem in Combinarotics
- Fishnet(暴力POJ 1408)
Fishnet Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 1911 Accepted: 1227 Descripti ...
- The Happy Worm 分类: POJ 排序 2015-08-03 18:57 5人阅读 评论(0) 收藏
The Happy Worm Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 4698 Accepted: 1047 Descr ...
- Bean的生命周期
Bean的生命周期 原文:http://997004049-qq-com.iteye.com/blog/1729793 任何一个事物都有自己的生命周期,生命的开始.生命中.生命结束.大家最熟悉的应该是 ...
- phpcms 04
首页index.html 首页头条推荐 <div class="col-left"> <div class="news-hot"> &l ...