在getSingleResult的源码里有这样一句: @throws EntityNotFoundException if there is no result 也就是说,查不到结果时,它是抛异常的,不会返回null..。