mybaits 笔记 insert

public voiddoExcel(Model model,@RequestBodyExcelDto excelDto, HttpServletRequest request, HttpServletResponse response)  {

String turl = request.getServletContext().getInitParameter("upload");

 String url =turl+"export.xls";

HSSFWorkbook wb= ExportUtil.saveExcel(excelDto,url);

PrintInfo printInfo =newPrintInfo();

printInfo = excelDto.getPrintInfo();

printInfoService.add(printInfo);

//System.out.println(printInfo.getId()+"返回主键id====");

List products = excelDto.getProudctList();

for(PrintProduct product :products){

product.setPrintInfoId(printInfo.getId());

printProductService.add(product);

}

}


insert不会放回保存对象,想获取保存对象之后id,通过调用保存方法之后,保存参数可以获得

你可能感兴趣的:(mybaits 笔记 insert)