In code generated by TOS, I see this pattern which sets a "null" value on insert when the value is missing in the source.
if (productOrder.order_currency == null) {
pstmt_tPostgresqlOutput_1.setNull(13,java.sql.Types.VARCHAR);
} else {
pstmt_tPostgresqlOutput_1.setString(13, productOrder.order_currency);
}
This results, when 'productOrder.order_currency' is null, in a SQL INSERT like so:
INSERT INTO "mytable" (..., ORDER_QUANTITY, ORDER_CURRENCY, ...) VALUES (..., 10, null, ...)
I would prefer to have it generate an insert statement like so, when order_currency is null:
INSERT INTO "mytable" (..., ORDER_QUANTITY, ...) VALUES (..., 10, ...)
And, when 'productOrder.order_currency' is not null, then it should include the column.
In other words, I would like to have the mapping skip columns that are missing from the input, instead of passing a null value (to leverage default values already present in column constraints on the target database table).
Please advise, thanks.
Ed