Пример #1
0
    private boolean hasParamAnnotation(Method method) {
      Annotation[][] paramAnnotationArrays = method.getParameterAnnotations();
      for (Annotation[] paramAnnotations : paramAnnotationArrays)
        for (Annotation paramAnnotation : paramAnnotations)
          if (paramAnnotation.annotationType().isAssignableFrom(Param.class)) return true;

      return false;
    }
Пример #2
0
 private QueryMethod chooseQueryMethodStrategy(
     Method method, RepositoryMetadata metadata, Class<?> repositoryInterface) {
   QueryMethod queryMethod;
   boolean paramAnnotation = false;
   if ((paramAnnotation = hasParamAnnotation(method))
       || repositoryInterface.isAnnotationPresent(Namespace.class)
       || method.isAnnotationPresent(Statement.class)) {
     queryMethod = new AnnotationBasedSqlMapQueryMethod(method, metadata, paramAnnotation);
   } else {
     queryMethod = new QueryMethod(method, metadata);
   }
   return queryMethod;
 }