/** * Checks whether the given method is a query method candidate. * * @param method * @return */ private boolean isQueryMethodCandidate(Method method) { return !method.isBridge() && !method.isDefault() // && !Modifier.isStatic(method.getModifiers()) // && (isQueryAnnotationPresentOn(method) || !isCustomMethod(method) && !isBaseClassMethod(method)); }
public Set<Method> getQueryMethods() { Set<Method> result = new HashSet<Method>(); for (Method method : getRepositoryInterface().getMethods()) { method = ClassUtils.getMostSpecificMethod(method, getRepositoryInterface()); if (!isCustomMethod(method) && !isBaseClassMethod(method)) { result.add(method); } } return Collections.unmodifiableSet(result); }
public boolean hasCustomMethod() { Class<?> repositoryInterface = getRepositoryInterface(); // No detection required if no typing interface was configured if (isGenericRepositoryInterface(repositoryInterface)) { return false; } for (Method method : repositoryInterface.getMethods()) { if (isCustomMethod(method) && !isBaseClassMethod(method)) { return true; } } return false; }
@Override public boolean hasCustomMethod() { Class<?> repositoryInterface = getRepositoryInterface(); // No detection required if no typing interface was configured if (isGenericRepositoryInterface(repositoryInterface)) { return false; } for (Method method : repositoryInterface.getMethods()) { if (isCustomMethod(method) && !isBaseClassMethod(method)) { return true; } } return false; }