fixed
methodSeeker add process paramtype
This commit is contained in:
parent
130170cfd5
commit
14f3adfcc5
|
@ -137,7 +137,7 @@ public class DBProxy {
|
|||
|
||||
if(params.size() > 0) {
|
||||
// method = dao.getClass().getMethod(methodName, Object.class);
|
||||
method = MethodSeeker.getMethod(dao.getClass(), methodName);
|
||||
method = MethodSeeker.getMethod(dao.getClass(), methodName, paramTypes);
|
||||
if (method == null) {
|
||||
throw new Exception("Not found method : " + methodName);
|
||||
}
|
||||
|
|
|
@ -21,10 +21,19 @@ public class MethodSeeker {
|
|||
}
|
||||
|
||||
|
||||
public static Method getMethod(Class cls, String methodName) {
|
||||
public static Method getMethod(Class cls, String methodName, List<Class> paramTypes) {
|
||||
|
||||
Method method = null;
|
||||
|
||||
if(paramTypes != null) {
|
||||
method = MethodSeeker.getMethodType(cls, methodName, paramTypes.toArray(new Class[paramTypes.size()]));
|
||||
}
|
||||
|
||||
if(method != null) {
|
||||
return method;
|
||||
}
|
||||
|
||||
|
||||
for(Class<?> type : MethodSeeker.typeList) {
|
||||
method = MethodSeeker.getMethodType(cls,methodName, type);
|
||||
if(method != null) {
|
||||
|
@ -36,7 +45,7 @@ public class MethodSeeker {
|
|||
|
||||
}
|
||||
|
||||
private static Method getMethodType(Class jpa, String methodName, Class<?> type) {
|
||||
private static Method getMethodType(Class jpa, String methodName, Class<?> ...type) {
|
||||
if (jpa == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user