Skip to content

Commit

Permalink
0004970: Auto resolve missing foreign key with load only or extract only
Browse files Browse the repository at this point in the history
node
  • Loading branch information
erilong committed May 18, 2021
1 parent 33060cb commit fba6f09
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -269,7 +269,12 @@ public void batchInError(DataContext context, Throwable ex) {
this.currentBatch.setSqlState(sqlState);
this.currentBatch.setSqlCode(se.getErrorCode());
this.currentBatch.setSqlMessage(se.getMessage());
ISqlTemplate sqlTemplate = symmetricDialect.getTargetPlatform(context.getTable().getName()).getSqlTemplate();
ISqlTemplate sqlTemplate = null;
if (context.getTable() != null) {
sqlTemplate = symmetricDialect.getTargetPlatform(context.getTable().getName()).getSqlTemplate();
} else {
sqlTemplate = symmetricDialect.getTargetPlatform().getSqlTemplate();
}
if (sqlTemplate.isForeignKeyViolation(se)) {
this.currentBatch.setSqlState(ErrorConstants.FK_VIOLATION_STATE);
this.currentBatch.setSqlCode(ErrorConstants.FK_VIOLATION_CODE);
Expand Down

0 comments on commit fba6f09

Please sign in to comment.