}
// have to do this because although saveResult and deleteResult
// are a) not the same class yet b) not subclassed
for (int i = 0; i < results.length; i++) {
Row dataRow = dataArray.get(i);
String statusMsg = null;
if (results instanceof SaveResult[]) {
SaveResult saveRes = (SaveResult)results[i];
if (saveRes.getSuccess()) {
if (OperationInfo.insert == getConfig().getOperationInfo()) {
statusMsg = Messages.getString("DAOLoadVisitor.statusItemCreated");
} else {
statusMsg = Messages.getString("DAOLoadVisitor.statusItemUpdated");
}
}
dataRow.put(Config.STATUS_COLUMN_NAME, statusMsg);
processResult(dataRow, saveRes.getSuccess(), saveRes.getId(), saveRes.getErrors());
} else if (results instanceof DeleteResult[]) {
DeleteResult deleteRes = (DeleteResult)results[i];
if (deleteRes.getSuccess()) {
statusMsg = Messages.getString("DAOLoadVisitor.statusItemDeleted");
}
dataRow.put(Config.STATUS_COLUMN_NAME, statusMsg);
processResult(dataRow, deleteRes.getSuccess(), deleteRes.getId(), deleteRes.getErrors());
} else if (results instanceof UpsertResult[]) {
UpsertResult upsertRes = (UpsertResult)results[i];
if (upsertRes.getSuccess()) {
statusMsg = upsertRes.getCreated() ? Messages.getString("DAOLoadVisitor.statusItemCreated")
: Messages.getString("DAOLoadVisitor.statusItemUpdated");
}
dataRow.put(Config.STATUS_COLUMN_NAME, statusMsg);
processResult(dataRow, upsertRes.getSuccess(), upsertRes.getId(), upsertRes.getErrors());
}
}
}