按id查询如果id不存在会报错javax.persistence.EntityNotFoundException: Unable to find com.nanl.domain.Girl with id 10添加@NotFound(action = NotFoundAction.IGNORE)不起作用怎么办
你要考虑清楚,你将要使用什么id生成策略,可以考虑在新增之前设置id,也可以使用随机生成的id,jpa实体的使用最好继承虚基类AbstractEntity