spring-data-jpa @RestController @Repository Optional strange behavior
问题 My @RestController @GetMapping("/projects/{project_id}") public Project getProjectById(@PathVariable(value = "project_id") UUID projectId) { return projectRepository.findById(projectId).orElseThrow(Util.notFound(projectId)); } My projectRepository is @Repository public interface ProjectRepository extends PagingAndSortingRepository<Project, UUID> { } public class Util { static Supplier<ResourceNotFoundException> notFound(UUID msg) { log.error(msg + " not found"); return () -> new