笔记
今天遇到的是一个链接问题
访问地址
http://localhost:8883/emps
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Aug 04 18:25:35 CST 2021
There was an unexpected error (type=Internal Server Error, status=500).
Unable to find pri.wcs.model.Department with id 6;
nested exception is javax.persistence.EntityNotFoundException:
Unable to find pri.wcs.model.Department with id 6
解决方案:看问题描述是没有找到Department id 6
emp表
Department 表
查询方法
原因 emp表与Department 表关联 使用jpa的查询方法 访问后,数据没有获得到Department 表的 id 6
解决方案: 删除掉emp表dept_id 为6 的即(暴力)
当然生产环境不能删