This question shows research effort; it is useful and clear
3
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
我已经从使用 Spring Data JPA 切换到带有实体管理器的常规 DAO 对象,并发现 .getSingleResult() 不是返回 null,而是抛出 NoResultException。有没有办法添加一个方面,用 Try {} Catch{} 包围所有 DAO 函数并返回 null 而不是 NoResultExceptions?