The following rules apply to the AuditMappings class:
Audit mappings are made available to an application by adding a class named AuditMappings with a audit_mappings stereotype to the model. Individual entity classes can then enable audit mappings by setting theAudit Fields option.
If the meta-model contains an AuditMappings class then a Java implementation class for it must be provided in the impl package.
The following rules apply to the AuditMappings implementation class:
public void set(final boolean isInsert, final boolean isModify)
This is a call back method which is called whenever necessary (i.e. during inserts and modifies) by the data access layer and should be used to populate the fields of the `AuditMappings` class. The two boolean parameters indicate whether the database operation is an insert or modify, respectively.
If the details struct contains any of the audit mapping fields, then these are updated in the struct automatically during the operation and are included in the update or insert.
For audit mapping fields, which are not present in the details struct, the corresponding field will still be updated on the database, i.e. it is not necessary to include the audit mapping fields in the details struct to get them updated on the database. Note however that such fields are not included in table level auditing.