使用easyPOI进行导入数据时的错误
domain结构:
表结构:
测试代码:
@Test
public void test() throws Exception {
ImportParams params = new ImportParams();
params.setTitleRows(1);
params.setHeadRows(1);
List<Student> list = ExcelImportUtil.importExcel(
new File("src/test/java/cn/pj/aisell/easypoi","stu-poi.xls"),
Student.class, params);
list.forEach(employee -> {
System.out.println(employee);
});
}
==错误原因:==提示说创建对象异常,是因为没有给student提供无参构造,所以一直报错