@@ -22,17 +22,25 @@ public Object invoke(Object proxy/* 对象的代理 */, Method method, Object[]
22
22
return method .invoke (this , args );
23
23
}
24
24
// wrap,getAnnotation() ops
25
- System .out .println (method .getName () + " invoke." );
26
- Annotation [] annotations = method .getAnnotations ();
27
- for (Annotation annotation : annotations ) {
28
- System .out .println ("annotation annotationType: " + annotation .annotationType ());
29
- if (annotation .annotationType () == Select .class ) {
30
- Select select = method .getAnnotation (Select .class );
31
- BaseExecutor executor = ExecutorFactory .newExecutor ();
32
- executor .doQuery (select .value ());
33
- // System.out.println("annotation value: " + select.value());
34
- }
25
+ // System.out.println(method.getName() + " invoke.");
26
+ // System.out.println(method.isAnnotationPresent(Select.class));
27
+ if (method .isAnnotationPresent (Select .class )) {
28
+ Select select = method .getAnnotation (Select .class );
29
+ BaseExecutor executor = ExecutorFactory .newExecutor ();
30
+ executor .doQuery (select .value ());
31
+ } else {
32
+ System .out .println (method .getName () + " no Select Annotation." );
35
33
}
34
+ // Annotation[] annotations = method.getAnnotations();
35
+ // for (Annotation annotation : annotations) {
36
+ // System.out.println("annotation annotationType: " + annotation.annotationType());
37
+ // if (annotation.annotationType() == Select.class) {
38
+ // Select select = method.getAnnotation(Select.class);
39
+ // BaseExecutor executor = ExecutorFactory.newExecutor();
40
+ // executor.doQuery(select.value());
41
+ //// System.out.println("annotation value: " + select.value());
42
+ // }
43
+ // }
36
44
// 接口不提供实现,需要自己实现方法处理逻辑
37
45
// MapperMethod--methodCache--sqlCommand,MethodSignature,Executor......
38
46
return null ;
0 commit comments