Skip to content

Commit

Permalink
0004293: Auto resolve fails for delete/update when existing child row
Browse files Browse the repository at this point in the history
references candidate key
  • Loading branch information
erilong committed Feb 27, 2020
1 parent 6757bba commit 2e5be6b
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,13 @@ protected boolean checkForForeignKeyChildExistsViolation(AbstractDatabaseWriter

protected boolean deleteForeignKeyChildren(IDatabasePlatform platform, ISqlTemplate sqlTemplate, DefaultDatabaseWriter databaseWriter, Table targetTable, CsvData data) {
Map<String, String> values = null;
if (data.getDataEventType().equals(DataEventType.UPDATE)) {
values = data.toColumnNameValuePairs(databaseWriter.getSourceTable().getPrimaryKeyColumnNames(), CsvData.PK_DATA);
} else {
if (data.getDataEventType().equals(DataEventType.INSERT)) {
values = data.toColumnNameValuePairs(databaseWriter.getSourceTable().getColumnNames(), CsvData.ROW_DATA);
} else {
values = data.toColumnNameValuePairs(databaseWriter.getSourceTable().getColumnNames(), CsvData.OLD_DATA);
if (values == null || values.size() == 0) {
values = data.toColumnNameValuePairs(databaseWriter.getSourceTable().getPrimaryKeyColumnNames(), CsvData.PK_DATA);
}
}

List<TableRow> tableRows = new ArrayList<TableRow>();
Expand Down

0 comments on commit 2e5be6b

Please sign in to comment.