From d718319782cf242330a27dfc408f36ae4821a7cd Mon Sep 17 00:00:00 2001 From: chenson42 Date: Tue, 22 Oct 2013 22:17:53 +0000 Subject: [PATCH] 0001449: Add support for allowing a database writer filter to change the target tables catalog, schema and table name --- .../org/jumpmind/symmetric/io/data/writer/DatabaseWriter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriter.java b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriter.java index d8e85e33ea..99ffd602e7 100644 --- a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriter.java +++ b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriter.java @@ -381,10 +381,11 @@ protected boolean filterBefore(CsvData data) { statistics.get(batch).startTimer(DataWriterStatisticConstants.FILTERMILLIS); for (IDatabaseWriterFilter filter : filters) { process &= filter.beforeWrite(this.context, this.sourceTable, data); - // re-lookup target table in case the source has changed + // re-lookup target table in case the source table has changed Table oldTargetTable = targetTable; targetTable = lookupTableAtTarget(this.sourceTable); if (!oldTargetTable.equals(targetTable)) { + // allow for auto increment columns to be inserted into if appropriate String quote = getPlatform().getDatabaseInfo().getDelimiterToken(); transaction.allowInsertIntoAutoIncrementColumns(false, oldTargetTable, quote); transaction.allowInsertIntoAutoIncrementColumns(true, targetTable, quote);