Skip to content

Commit 1fd3207

Browse files
committedFeb 9, 2020
public final class Class<T> implements java.io.Serializable, GenericDeclaration, Type, AnnotatedElement 继承体系之Class
1 parent 933d420 commit 1fd3207

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed
 

‎.idea/workspace.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/main/java/org/pp/mybatis/foundationsupportlayer/reflector/proxy/jdk/JdkInterfaceDynamicProxyHandler.java

+18-10
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,25 @@ public Object invoke(Object proxy/* 对象的代理 */, Method method, Object[]
2222
return method.invoke(this, args);
2323
}
2424
// 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.");
3533
}
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+
// }
3644
// 接口不提供实现,需要自己实现方法处理逻辑
3745
// MapperMethod--methodCache--sqlCommand,MethodSignature,Executor......
3846
return null;

0 commit comments

Comments
 (0)
Failed to load comments.