Navigation Menu

Skip to content

Commit

Permalink
0001149: Log error message when an invalid sync_key_name column is sp…
Browse files Browse the repository at this point in the history
…ecified. If no columns match, then return the original keys.
  • Loading branch information
chenson42 committed Mar 29, 2013
1 parent 119f063 commit de79485
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -43,7 +43,7 @@ public class Trigger implements Serializable {

private static final long serialVersionUID = 1L;

static final Logger logger = LoggerFactory.getLogger(Trigger.class);
static final Logger log = LoggerFactory.getLogger(Trigger.class);

private static int maxTriggerId;

Expand Down Expand Up @@ -159,9 +159,16 @@ public Column[] getSyncKeysColumnsForTable(Table table) {
Column col = table.getColumnWithName(syncKey);
if (col != null) {
columns.add(col);
} else {
log.error("The sync key column '{}' was specified for the '{}' trigger but was not found in the table", syncKey, triggerId);
}
}
return columns.toArray(new Column[columns.size()]);

if (columns.size() > 0) {
return columns.toArray(new Column[columns.size()]);
} else {
return table.getPrimaryKeyColumns();
}
} else {
return table.getPrimaryKeyColumns();
}
Expand Down

0 comments on commit de79485

Please sign in to comment.