List<Bdinfo> bdinfos= this.getByIds(Bdinfo.class,
bdinfoIds.toArray(new String[bdinfoIds.size()]));
for (Bdinfo bdinfo : bdinfos) {
// 版本处理
bizService.saveVer(bdinfo, xxxx, xxxx);
// 删除Project表
Project project = bdinfo.getPjid();
if(project.getBdinfoCollection()==null && project.getBdintentCollection()==null){
}
}
在saveVer方法中有调用:template.clear();
如此操作后调用该方法会提示:failed to lazily initialize a collection of role
修改为:
for (Bdinfo bdinfo : bdinfos) {
// 版本处理
bizService.saveVer(bdinfo, xxxx, xxxx);
// 删除Project表
//Project project = bdinfo.getPjid();
[color=red] Project project = getById(Project.class, bdinfo.getPjid().getId()); // 避免延迟加载的异常[/color]
if(project.getBdinfoCollection()==null && project.getBdintentCollection()==null){
}
}
bdinfoIds.toArray(new String[bdinfoIds.size()]));
for (Bdinfo bdinfo : bdinfos) {
// 版本处理
bizService.saveVer(bdinfo, xxxx, xxxx);
// 删除Project表
Project project = bdinfo.getPjid();
if(project.getBdinfoCollection()==null && project.getBdintentCollection()==null){
}
}
在saveVer方法中有调用:template.clear();
如此操作后调用该方法会提示:failed to lazily initialize a collection of role
修改为:
for (Bdinfo bdinfo : bdinfos) {
// 版本处理
bizService.saveVer(bdinfo, xxxx, xxxx);
// 删除Project表
//Project project = bdinfo.getPjid();
[color=red] Project project = getById(Project.class, bdinfo.getPjid().getId()); // 避免延迟加载的异常[/color]
if(project.getBdinfoCollection()==null && project.getBdintentCollection()==null){
}
}