java.lang.NoSuchMethodException when invoke method dynamic
hi!
i have some trouble when i invoked hibernate PO class method dymaic by parameters, here is a piece of code, can someone help me? thanks in advance! please!
String fieldname = field.getName().toLowerCase();
String methodName = "get" + fieldname.replaceFirst(fieldname.substring(0, 1),fieldname.substring(0,1).toUpperCase());
Method methodFinal;
try {
methodFinal = value.getClass().getDeclaredMethod(methodName, new Class[] {PaymentPO.class});
return methodFinal.invoke(value, null);
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}

