tuple[0] = newTrade.tradeId; // th_t_id
switch (i) {
case 0:
tuple[1] = new TimestampType(getCurrentTradePendingTime()); // th_dts
tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_PENDING.ordinal())[0]; // th_st_id
break;
case 1:
tuple[1] = new TimestampType(getCurrentTradeSubmissionTime()); // th_dts
tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_SUBMITTED.ordinal())[0]; // th_st_id
break;
case 2:
tuple[1] = new TimestampType(getCurrentTradeCompletionTime()); // th_dts
tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_COMPLETED.ordinal())[0]; // th_st_id
break;
default:
assert false;
}
tradeHistory.add(tuple);
}
}
else {
for (int i = 0; i < 2; i++) {
Object[] tuple = new Object[columnsNum];
tuple[0] = newTrade.tradeId; // th_t_id
switch (i) {
case 0:
tuple[1] = new TimestampType(getCurrentTradeSubmissionTime()); // th_dts
tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_SUBMITTED.ordinal())[0]; // th_st_id
break;
case 1:
tuple[1] = new TimestampType(getCurrentTradeCompletionTime()); // th_dts
tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_COMPLETED.ordinal())[0]; // th_st_id
break;
default:
assert false;