- Create Dummy Columns on empty import of table columns

This commit is contained in:
mohitdeuex 2024-04-09 11:08:04 +05:30
parent 7bc48ffd0d
commit a41dc54667

View File

@ -1309,10 +1309,18 @@ public class TableRepository extends EntityRepository<Table> {
? ""
: entity.getDomain().getFullyQualifiedName();
addField(recordList, domain);
addRecord(csvFile, recordList, table.getColumns().get(0), false);
if (!nullOrEmpty(table.getColumns())) {
addRecord(csvFile, recordList, table.getColumns().get(0), false);
for (int i = 1; i < entity.getColumns().size(); i++) {
addRecord(csvFile, new ArrayList<>(), table.getColumns().get(i), true);
for (int i = 1; i < entity.getColumns().size(); i++) {
addRecord(csvFile, new ArrayList<>(), table.getColumns().get(i), true);
}
} else {
// Create a dummy Entry for the Column
for (int i = 0; i < 9; i++) {
addField(recordList, (String) null); // Add empty fields for table information
}
addRecord(csvFile, recordList);
}
}