mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-21 06:28:44 +00:00
CE-1955 Make sure to skip blank rows (e.g., no columns had a value)
This commit is contained in:
@ -62,12 +62,22 @@ public class FlatRowsToRecord implements RowsToRecordInterface
|
||||
QRecord record = new QRecord();
|
||||
BulkLoadRecordUtils.addBackendDetailsAboutFileRows(record, row);
|
||||
|
||||
boolean anyValuesFromFileUsed = false;
|
||||
for(QFieldMetaData field : table.getFields().values())
|
||||
{
|
||||
setValueOrDefault(record, field, null, mapping, row, fieldIndexes.get(field.getName()));
|
||||
if(setValueOrDefault(record, field, null, mapping, row, fieldIndexes.get(field.getName())))
|
||||
{
|
||||
anyValuesFromFileUsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
rs.add(record);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// avoid building empty records (e.g., "past the end" of an Excel file) //
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if(anyValuesFromFileUsed)
|
||||
{
|
||||
rs.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
BulkLoadValueMapper.valueMapping(rs, mapping, table);
|
||||
|
Reference in New Issue
Block a user