diff --git a/excel-importer-test/src_test/com/axonivy/util/excel/test/TestEntityClassCreator.java b/excel-importer-test/src_test/com/axonivy/util/excel/test/TestEntityClassCreator.java index 7d21897..b55bee1 100644 --- a/excel-importer-test/src_test/com/axonivy/util/excel/test/TestEntityClassCreator.java +++ b/excel-importer-test/src_test/com/axonivy/util/excel/test/TestEntityClassCreator.java @@ -47,6 +47,11 @@ void readGermanized(@TempDir Path dir) throws Exception { assertThat(entity.getField("anzahlInneresBehltnis").getComment()) .as("preserve real column names") .isEqualTo("Anzahl Inneres Behältnis"); + + assertThat(entity.getField("zulassungsinhaberName").getType()) + .isEqualTo(String.class.getName()); + assertThat(entity.getField("pNRZulassungsinhaber").getType()) + .isEqualTo(Double.class.getName()); } @BeforeEach diff --git a/excel-importer/src/com/axonivy/util/excel/importer/ExcelReader.java b/excel-importer/src/com/axonivy/util/excel/importer/ExcelReader.java index 4cb7da4..b6d67b9 100644 --- a/excel-importer/src/com/axonivy/util/excel/importer/ExcelReader.java +++ b/excel-importer/src/com/axonivy/util/excel/importer/ExcelReader.java @@ -5,7 +5,6 @@ import java.util.List; import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; @@ -36,20 +35,19 @@ private static List createEntityFields(List names, Iterator return List.of(); } Row row = rowIterator.next(); - Iterator cellIterator = row.cellIterator(); - int cellNo = 0; - while (cellIterator.hasNext()) { - Cell cell = cellIterator.next(); - var name = names.get(cellNo); - var column = toColumn(name, cell.getCellType()); + for(int c = 0; c