You cannot hide individual Spring Data repository methods, all interface methods are public by design. Spring Data creates a proxy that implements your repository interface. The methods it implements must be part of that public contract. A method in an interface is effectively public for consumers (and Spring Data won’t create a query for a private interface method anyway). So annotating a private method with @Query
won’t be picked up.