天天看點

mysql無法添加或更新子行_不能添加或更新子行:外鍵限制失敗

org.springframework.dao.DataIntegrityViolationException:

### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`imoceo2o`.`tb_shop`, CONSTRAINT `fk_shop_shopcate` FOREIGN KEY (`shop_category_id`) REFERENCES `tb_shop_category` (`shop_category_id`))

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: insert into     tb_shop(owner_id,area_id,shop_category_id,shop_name,shop_desc,shop_addr,phone,shop_img,priority,create_time,last_edit_time,enable_status,advice)    values    (?,?,?,?,    ?,?,?,?,?,?,?,?,?)

### Cause: