2
回答
javassist创建方法问题
sBuf_update.append("update.setParams("+getMethod+");\r\n");

setParams 方法参数为Object

报错

javassist.CannotCompileException: [source error] setParams(int) not found in webFrame.app.db.query.Query
at javassist.CtBehavior.setBody(CtBehavior.java:446)
at javassist.CtBehavior.setBody(CtBehavior.java:412)

若强制转换

sBuf_update.append("update.setParams((Object)"+getMethod+");\r\n");

报错:

javassist.CannotCompileException: [source error] invalid cast
at javassist.CtBehavior.setBody(CtBehavior.java:446)
at javassist.CtBehavior.setBody(CtBehavior.java:412)
举报
panmingguang
发帖于5年前 2回/592阅
顶部