Alexandra - 2012-07-17

Hi,

I am trying to modify a Statement object and add a new column and its associated value. Here is the code snippet:

List<Column> columns = null;
Table table = null;
List<Expression> expressions = null;
if (statement instanceof Insert) {
    columns = ((Insert)statement).getColumns();
    table = ((Insert) statement).getTable();
    expressions = ((Update)statement).getExpressions(); 
} 
else if (statement instanceof Update) {
    columns = ((Update)statement).getColumns();
    table = ((Update) statement).getTable();
    expressions = ((Update)statement).getExpressions();
}
Column newColumn = new Column(table, "`mention_id`");
StringValue newValue = new StringValue(new String(mention_id));
columns.add(newColumn);
expressions.add(newValue);

The problem is that the value added is deleted after the last line of code, when calling add. Can you please help me solve this problem?

Thanks,
Alexandra