代码
List<Yszw> zws = genZwData();
dao.insertWith(zws, null);
错误日志
Exception in thread "pool-1-thread-28" java.lang.RuntimeException: Fail to invoke getter lulu.code_lab.framework.random_bean.bean.Yszw.'getSjs()' <class java.util.ArrayList> because [java.lang.IllegalArgumentException: java.lang.ClassCastException@1d532258]: java.lang.ClassCastException@1d532258
at org.nutz.lang.Lang.makeThrow(Lang.java:104)
at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:31)
at org.nutz.dao.impl.entity.field.AbstractEntityField.getValue(AbstractEntityField.java:57)
at org.nutz.dao.impl.link.DoInsertLinkVisitor.visit(DoInsertLinkVisitor.java:22)
at org.nutz.dao.impl.entity.LinkFieldSet.visit(LinkFieldSet.java:41)
at org.nutz.dao.impl.entity.NutEntity.visitMany(NutEntity.java:337)
at org.nutz.dao.impl.NutDao.insertWith(NutDao.java:227)
at random_bean.RandHyhjData.lambda$0(RandHyhjData.java:59)
@Table("T_YS_ZW")
public class Yszw {
@Id(auto = false)
Long PID;
Long FID;
String ZH;
String ZLX;
Double WD;
Double JD;
Date GCSJ_D;
Timestamp GCSJ_T;
Long GCSJ_L;
Integer GCSJ_P_N;
Integer GCSJ_P_Y;
Integer GCSJ_P_R;
Integer GCSJ_P_S;
Integer GCSJ_P_F;
Integer GCSJ_P_M;
@Many(target = Yssj.class, field = "ZWID")
List<Yssj> sjs;
}
@Table("T_YS_SJ")
public class Yssj {
@Id(auto = false)
Long PID;
Long HCID;
Long ZWID;
Double F1;
Double F2;
Double F3;
Double F4;
Double F5;
Double F6;
Double F7;
Double F8;
Double F9;
Double F10;
}
dao.insertWith不支持保存集合吗?