Java 使用spring boot和poi将4个表连接到excel后创建excel工作表数据

Java 使用spring boot和poi将4个表连接到excel后创建excel工作表数据,java,excel,spring-boot,api,apache-poi,Java,Excel,Spring Boot,Api,Apache Poi,我想创建一个关于SpringBootRESTAPI的excel。我使用POI jar创建excel,但始终收到以下响应“{ “时间戳”:“2020-11-25T10:10:16.723+00:00”, “消息”:“查询未返回唯一结果:2;嵌套异常为javax.persistence.ununiqueresultexception:查询未返回唯一结果:2”, “地位”:500 }请协助我,我是个大人物 " //Exceel帮助程序类 公共类助手{ 公共静态字符串TYPE=“application

我想创建一个关于SpringBootRESTAPI的excel。我使用POI jar创建excel,但始终收到以下响应“{ “时间戳”:“2020-11-25T10:10:16.723+00:00”, “消息”:“查询未返回唯一结果:2;嵌套异常为javax.persistence.ununiqueresultexception:查询未返回唯一结果:2”, “地位”:500 }请协助我,我是个大人物 "

//Exceel帮助程序类
公共类助手{
公共静态字符串TYPE=“application/vnd.openxmlformats officedocument.spreadsheetml.sheet”;
静态字符串[]头={
“学生罗尔诺”,
“学生全名”,
“学生父亲姓名”,
“studentMotherName”,
“studentDob”,
“学生性别”,
“学生邮件”,
“学生联络号码”,
“学生地址”,
“studentZipCode”,
“学生州”,
“学生城”,
“学生教育ID”,
“学生教育分数”,
“学生教育年”,
“学生教育HSSCMarks”,
“学生教育HSSCStream”,
“学生教育HSSCPASEAR”,
“学生教育研究生课程”,
“学生教育程度GPA”,
“学生教育毕业年份”,
“学生教育课程”,
“学生教育PGCGPA”,
“学生教育年度”,
“学生教育年”,
“学生教育学院”,
“学生认证ID”,
“学生认证”详细信息,
“学生认证头衔”,
“学生认证日期”
};
公共静态ByteArrayInputStream tutorialsToExcel(列出学生){
尝试(工作簿=新XSSFWORKWORK();
ByteArrayOutputStream out=新建ByteArrayOutputStream();)
{
CreationHelper createHelper=workbook.getCreationHelper();
工作表=工作簿.createSheet();
Font-headerFont=workbook.createFont();
headerFont.setBold(真);
setColor(IndexedColors.BLUE.getIndex());
CellStyle headerCellStyle=工作簿.createCellStyle();
headerCellStyle.setFont(headerFont);
//标题行
Row headerRow=sheet.createRow(0);
//标题
for(int col=0;col