@JFinal 文档中有说明,是不是只对主键有效?我在开发过程中,发现确实如此。
代码中我是这样写的
运行的时候报错了。
Sql: insert into KC41(AAE011, AAE013, AAE036, AID001, AID002, AID003, AKB200, AKB201, AKC124, AKC190, AKC220, AKC222, AKC224, AKC255, AKE020, BKB200, BKB201, BKC220, BKC221, BKE001, BKE002, BZE011, BZE013, BZE036, CKC218, EKC101) values(?, ?, ?, SEQ_AID001.nextval, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 25 at com.jfinal.plugin.activerecord.DbPro.batch(DbPro.java:1106) at com.jfinal.plugin.activerecord.DbPro.batchSave(DbPro.java:1206) at com.jfinal.plugin.activerecord.Db.batchSave(Db.java:652) at com.zshsoft.web.db.model.BaseModel.batchSave(BaseModel.java:359) at com.zshsoft.web.db.model.BaseModel.batchSave(BaseModel.java:369) at com.zshsoft.service.medical.inpatient.KC41Service.lambda$0(KC41Service.java:138) at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:796) at com.jfinal.plugin.activerecord.DbPro.tx(DbPro.java:829) at com.jfinal.plugin.activerecord.Db.tx(Db.java:542) at com.zshsoft.service.medical.inpatient.KC41Service.jiaodui(KC41Service.java:44) at com.zshsoft.controller.medical.inpatient.KC41Controller.jiaodui(KC41Controller.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
如果我先将序列取出来,再赋值,则可正常写入数据。
项目:JFinal