求救:hibermate foreign key导致的Cannot add or update a child row问题
2.b表:key主键,add
b表*.hbm.xml的配置文件相关配置
<many-to-one name="akey" column="a_key" class="路径/a" not-null="true" lazy="false"/>
SchemaUpdate-alter table b add index FKB23B8F27CFEAA390 (key), add constraint FKB23B8F27CFEAA390 foreign key (key) references a (id)
NewPooledConnection-com.mchange.v2.c3p0.impl.NewPooledConnection@246c7a05 handling a throwable.
java.sql.SQLIntegrityConstraintViolationException: (conn=25394) Cannot add or update a child row: a foreign key constraint fails (`数据库`.`#sql-54b_6332`, CONSTRAINT `FKB23B8F27CFEAA390` FOREIGN KEY (`key`) REFERENCES `a` (`id`))
相关推荐
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
报错的原因大概分为三种: 原因一: 添加的外键列与另一个表的唯一索引列(一般是主键)的数据类型不同 原因二: 要添加外键的表类型与另一个表的存储引擎是不是都为innodb引擎 #查看表引擎 法一: show create table 表名; 法二:show table status from 数据库 where name=‘表名’; 法三:use information_schema; select table_catalog,table_schema,table_name,engine from tab
Mysql出现问题:ERROR 1216: Cannot add or update a child row: a foreign key constraint fails解决方案
Mysql出现问题:ERROR 1216: Cannot add or update a child row: a foreign key constraint fails解决方案
高校技术转移办公室人员如何高效开展技术需求挖掘工作?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
科技中介服务机构如何提升服务的专业性与用户粘性?.docx
科技中介服务机构如何提升服务的专业性与用户粘性?
高校技术转移办公室人员在组织科研成果展示时,如何提升推介材料的专业性与吸引力?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。


