Skip to content

Commit

Permalink
spell expression correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Mar 26, 2012
1 parent 2712ca4 commit a9c666c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Expand Up @@ -489,15 +489,15 @@ public void save(ConflictSettingNodeGroupLink setting) {
.getTargetSchemaName(), setting.getTargetTableName(), setting.getDetectType()
.name(), setting.getResolveType().name(),
setting.isResolveChangesOnly() ? 1 : 0, setting.isResolveRowOnly() ? 1 : 0, setting
.getDetectExpresssion(), setting.getLastUpdateBy(), setting
.getDetectExpression(), setting.getLastUpdateBy(), setting
.getConflictId()) == 0) {
sqlTemplate.update(getSql("insertConflictSettingsSql"), setting.getNodeGroupLink()
.getSourceNodeGroupId(), setting.getNodeGroupLink().getTargetNodeGroupId(),
setting.getTargetChannelId(), setting.getTargetCatalogName(), setting
.getTargetSchemaName(), setting.getTargetTableName(), setting
.getDetectType().name(), setting.getResolveType().name(),
setting.isResolveChangesOnly() ? 1 : 0, setting.isResolveRowOnly() ? 1 : 0,
setting.getDetectExpresssion(), setting.getLastUpdateBy(), setting
setting.getDetectExpression(), setting.getLastUpdateBy(), setting
.getConflictId());
}
}
Expand Down Expand Up @@ -553,7 +553,7 @@ public ConflictSettingNodeGroupLink mapRow(Row rs) {
"resolve_type").toUpperCase()));
setting.setResolveChangesOnly(rs.getBoolean("resolve_changes_only"));
setting.setResolveRowOnly(rs.getBoolean("resolve_row_only"));
setting.setDetectExpresssion(rs.getString("detect_expression"));
setting.setDetectExpression(rs.getString("detect_expression"));
setting.setLastUpdateBy(rs.getString("last_update_by"));
setting.setConflictId(rs.getString("conflict_id"));
setting.setCreateTime(rs.getDateTime("create_time"));
Expand Down
Expand Up @@ -24,7 +24,7 @@ public enum ResolveConflict {
private String targetSchemaName;
private String targetTableName;
private DetectConflict detectType = DetectConflict.USE_PK_DATA;
private String detectExpresssion;
private String detectExpression;
private ResolveConflict resolveType = ResolveConflict.FALLBACK;
private boolean resolveChangesOnly = true;
private boolean resolveRowOnly = true;
Expand Down Expand Up @@ -113,12 +113,12 @@ public void setResolveRowOnly(boolean resolveRowOnly) {
this.resolveRowOnly = resolveRowOnly;
}

public String getDetectExpresssion() {
return detectExpresssion;
public String getDetectExpression() {
return detectExpression;
}

public void setDetectExpresssion(String conflictColumnName) {
this.detectExpresssion = conflictColumnName;
public void setDetectExpression(String conflictColumnName) {
this.detectExpression = conflictColumnName;
}

public Date getCreateTime() {
Expand Down
Expand Up @@ -346,13 +346,13 @@ protected LoadStatus delete(CsvData data) {
case USE_TIMESTAMP:
List<Column> lookupColumns = new ArrayList<Column>();
Column versionColumn = targetTable.getColumnWithName(conflictSettings
.getDetectExpresssion());
.getDetectExpression());
if (versionColumn != null) {
lookupColumns.add(versionColumn);
} else {
log.error(
"Could not find the timestamp/version column with the name {}. Defaulting to using primary keys for the lookup.",
conflictSettings.getDetectExpresssion());
conflictSettings.getDetectExpression());
}
Column[] pks = targetTable.getPrimaryKeyColumns();
for (Column column : pks) {
Expand Down Expand Up @@ -441,13 +441,13 @@ protected LoadStatus update(CsvData data, boolean applyChangesOnly, boolean useC
case USE_TIMESTAMP:
lookupColumns = new ArrayList<Column>();
Column versionColumn = targetTable
.getColumnWithName(conflictSettings.getDetectExpresssion());
.getColumnWithName(conflictSettings.getDetectExpression());
if (versionColumn != null) {
lookupColumns.add(versionColumn);
} else {
log.error(
"Could not find the timestamp/version column with the name {}. Defaulting to using primary keys for the lookup.",
conflictSettings.getDetectExpresssion());
conflictSettings.getDetectExpression());
}
pks = targetTable.getPrimaryKeyColumns();
for (Column column : pks) {
Expand Down
Expand Up @@ -140,7 +140,7 @@ public void needsResolved(DatabaseWriter writer, CsvData data, LoadStatus loadSt

protected boolean isTimestampNewer(Conflict conflictSetting, DatabaseWriter writer,
CsvData data) {
String columnName = conflictSetting.getDetectExpresssion();
String columnName = conflictSetting.getDetectExpression();
Table table = writer.getTargetTable();
String[] pkData = data.getPkData(table);
Object[] objectValues = writer.getPlatform().getObjectValues(
Expand All @@ -156,7 +156,7 @@ protected boolean isTimestampNewer(Conflict conflictSetting, DatabaseWriter writ

protected boolean isVersionNewer(Conflict conflictSetting, DatabaseWriter writer,
CsvData data) {
String columnName = conflictSetting.getDetectExpresssion();
String columnName = conflictSetting.getDetectExpression();
Table table = writer.getTargetTable();
String[] pkData = data.getPkData(table);
Object[] objectValues = writer.getPlatform().getObjectValues(
Expand Down
Expand Up @@ -44,7 +44,7 @@ public void notExpectingError() {
public void testUpdateDetectTimestampNewerWins() {
Conflict setting = new Conflict();
setting.setDetectType(DetectConflict.USE_TIMESTAMP);
setting.setDetectExpresssion("time_value");
setting.setDetectExpression("time_value");
setting.setResolveRowOnly(true);
setting.setResolveChangesOnly(true);
setting.setResolveType(ResolveConflict.NEWER_WINS);
Expand Down

0 comments on commit a9c666c

Please sign in to comment.