Skip to content

Commit

Permalink
change current_timestamp variable column transform option to system_t…
Browse files Browse the repository at this point in the history
…imestamp to help out informix unit tests
  • Loading branch information
chenson42 committed Aug 14, 2011
1 parent 47ab9e7 commit ffe24e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -12,20 +12,28 @@ public class VariableColumnTransform implements ISingleValueColumnTransform, IBu

protected static final String DATE_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS";

protected static final String OPTION_TIMESTAMP = "system_timestamp";

private static final String[] OPTIONS = new String[] {OPTION_TIMESTAMP};

public boolean isAutoRegister() {
return true;
}

public String getName() {
return NAME;
}

public static String[] getOptions() {
return OPTIONS;
}

public String transform(ICacheContext context, TransformColumn column,
TransformedData data, Map<String, String> sourceValues, String value, String oldValue) throws IgnoreColumnException,
IgnoreRowException {
String varName = column.getTransformExpression();
if (varName != null) {
if (varName.equalsIgnoreCase("current_timestamp")) {
if (varName.equalsIgnoreCase(OPTION_TIMESTAMP)) {
return DateFormatUtils.format(System.currentTimeMillis(), DATE_PATTERN);
}
}
Expand Down
Expand Up @@ -112,7 +112,7 @@ insert into sym_transform_column (transform_id, include_on, source_column_name,
insert into sym_transform_column (transform_id, include_on, source_column_name, target_column_name, pk, transform_type, transform_expression, transform_order)
values ('sourceb_to_b', '*', null, 'S1_B', 0, 'lookup', 'select column_two from test_lookup_table where column_one=:ID', 2);
insert into sym_transform_column (transform_id, include_on, source_column_name, target_column_name, pk, transform_type, transform_expression, transform_order)
values ('sourceb_to_b', '*', null, 'S2_B', 0, 'variable', 'current_timestamp', 3);
values ('sourceb_to_b', '*', null, 'S2_B', 0, 'variable', 'system_timestamp', 3);

insert into sym_transform_table (transform_id, source_node_group_id, target_node_group_id, source_table_name, target_table_name, transform_point, update_first, delete_action, transform_order)
values ('one_to_multi', 'test-node-group', 'test-root-group', 'SOURCE_5', 'TARGET_5', 'LOAD', 0, 'NONE', 1);
Expand Down

0 comments on commit ffe24e3

Please sign in to comment.