ERROR 4388 --- [io-10086-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:
### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`crm`.`cst_customer`, CONSTRAINT `cstsc_KY_base` FOREIGN KEY (`cust_source`) REFERENCES `base_dict` (`dict_type_code`) ON DELETE CASCADE ON UPDATE CASCADE)
解决方法:因为外键关联的字段不是主键,或者是外键关联的字段不具有唯一性,就是是外键关联的字段里有重复的数值,不具备唯一性,导致映射出错。
详细讲解可以参考文章: