我检查了代码库-似乎他们已明确禁用了自定义方法-不知道为什么。这是来自org.springframework.data.repository.core.support.DefaultRepositoryInformation的相关代码
@Overridepublic Set<Method> getQueryMethods() { Set<Method> result = new HashSet<Method>(); for (Method method : getRepositoryInterface().getMethods()) { method = ClassUtils.getMostSpecificMethod(method, getRepositoryInterface()); if (isQueryMethodCandidate(method)) { result.add(method); } } return Collections.unmodifiableSet(result);}private boolean isQueryMethodCandidate(Method method) { return isQueryAnnotationPresentOn(method) || !isCustomMethod(method) && !isbaseClassMethod(method);}


