关于hibernate的saveOrUpdateAll有关问题,跪求大神帮忙
关于hibernate的saveOrUpdateAll问题,跪求大神帮忙
this.getHibernateTemplate().saveOrUpdateAll(listBsetModel);
listBsetModel是一个实体集合,里面有存储的实体已有映射,
语句执行后报java.sql.BatchUpdateException: ORA-01407: 无法更新 ("SMARTGPS2006"."BAKTARCORP"."TARGETID") 为 NULL
BsetModel 和 BcorpModel 为一对多
public class BsetModel {
private String targetid; //车机Sim卡号
private Integer valall; //总数不少于
private Integer valx; //经度为0不多于
private Integer valy; //纬度为0不多于
private Integer valtimeerr;//时间异常不多于
private Integer valloaded; //空重车异常不多于
private Set<BcorpModel> bcorpModel = new HashSet<BcorpModel>();
public Set<BcorpModel> getBcorpModel() {
return bcorpModel;
}
public void setBcorpModel(Set<BcorpModel> bcorpModel) {
this.bcorpModel = bcorpModel;
}
------解决思路----------------------
用saveorupdate()这个方法
this.getHibernateTemplate().saveOrUpdateAll(listBsetModel);
listBsetModel是一个实体集合,里面有存储的实体已有映射,
语句执行后报java.sql.BatchUpdateException: ORA-01407: 无法更新 ("SMARTGPS2006"."BAKTARCORP"."TARGETID") 为 NULL
BsetModel 和 BcorpModel 为一对多
public class BsetModel {
private String targetid; //车机Sim卡号
private Integer valall; //总数不少于
private Integer valx; //经度为0不多于
private Integer valy; //纬度为0不多于
private Integer valtimeerr;//时间异常不多于
private Integer valloaded; //空重车异常不多于
private Set<BcorpModel> bcorpModel = new HashSet<BcorpModel>();
public Set<BcorpModel> getBcorpModel() {
return bcorpModel;
}
public void setBcorpModel(Set<BcorpModel> bcorpModel) {
this.bcorpModel = bcorpModel;
}
------解决思路----------------------
用saveorupdate()这个方法