Obviously, your spring-data-jpa version is 2.x. They renamed findOne()
to findById()
(and changed its signature a bit).
The findOne()
still exists in QueryByExampleExecutor, but it can be used only for queries by example, not for searching by primary key.
So, use this:
organisationRepository.findById(1L).orElse(null);
CLICK HERE to find out more related problems solutions.