The JTSQLTableSummaryLogger
component extends JTSQLTableLogger
. It adds a new property, DBWriteMethod
, which determines how summary log information is written to the SQL database table. The DBWriteMethod
property is a string whose valid values are insert
and update
.
If you use the update
write method (DBWriteMethod=update
), you also need to configure the SQLColumnMappings
property of the JTSQLTableSummaryLogger
. If a property should be incremented when the table is updated, use the :add
string in the SQLColumnMappings
property. If a property should be set to the new value when the table is updated, use the :set
string in the SQLColumnMappings
property. For example:
SQLColumnMappings=cartItems:itemsPurchased:add
You can define more than one value in SQLColumnMappings
, as in this example:
SQLColumnMappings=company:comp_id:set,dept:dept_id:set,hits:num_hits:add