eova采用java 1.8编译时删除功能出错
Kid Lueng 发布于96月前 3答/1408阅

我想实现的功能:eova采用java 1.8编译时删除功能出错


过程中遇到的问题:eova采用java 1.8编译时删除功能出错


我的分析过程如下:eova采用java 1.8编译时删除功能出错

使用原版jfinal没问题,应该是修改了RecordBuilder所欲出错了.

java.lang.ClassCastException: java.lang.Integer cannot be cast to [Ljava.lang.Object;
    at com.jfinal.plugin.activerecord.DbPro.delete(DbPro.java:434)
    at com.eova.widget.grid.GridController$2.run(GridController.java:280)
    at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:720)
    at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:757)
    at com.jfinal.plugin.activerecord.Db.tx(Db.java:460)
    at com.eova.widget.grid.GridController.delete(GridController.java:260)


用java 1.8编译eova项目时,使用删除功能时就会报错

解决方案

com.jfinal.plugin.activerecord.DbPro line 434
return deleteById(tableName, primaryKey, record.get(primaryKey));

改为
return deleteById(tableName, primaryKey, new Object[]{record.get(primaryKey)});



[沙发] Jieven
至于上面说的JFinal2.2代码问题,应该是:
public boolean deleteById(String tableName, Object idValue) {
public boolean deleteById(String tableName, String primaryKey, Object... idValue) {
JDK1.8 不兼容的语法是 Object...
亮点
[地板] Jieven
因为jdk1.8 不向下兼容,所以Eova目前只能使用 JDK1.5-1.7 推荐使用JDK1.7
[地毯] 股往金来
怪不得,我也发现这个问题了。还是楼主细心,查到根源
提交评论
嘿,我来帮你!