Class AuditAction


public class AuditAction extends AbstractQActionFunction<AuditInput,AuditOutput>
Insert 1 or more audits (and optionally their children, auditDetails) Takes care of managing the foreign key tables (auditTable, auditUser). Enforces that security key values are provided, if the table has any. Note that might mean a null is given for a particular key, but at least the key must be present.
  • Constructor Details

    • AuditAction

      public AuditAction()
  • Method Details

    • execute

      public static void execute(String tableName, Integer recordId, Map<String,Serializable> securityKeyValues, String message)
      Execute to insert 1 audit, with no details (child records)
    • executeWithStringDetails

      public static void executeWithStringDetails(String tableName, Integer recordId, Map<String,Serializable> securityKeyValues, String message, List<String> detailMessages)
      Execute to insert 1 audit, with a list of detail child records provided as just string messages
    • execute

      public static void execute(String tableName, Integer recordId, Map<String,Serializable> securityKeyValues, String message, List<QRecord> details)
      Execute to insert 1 audit, with a list of detail child records
    • appendToInput

      public static void appendToInput(AuditInput auditInput, QTableMetaData table, QRecord record, String auditMessage)
      Simple overload that internally figures out primary key and security key values Be aware - if the record doesn't have its security key values set (say it's a partial record as part of an update), then those values won't be in the security key map... This should probably be considered a bug.
    • appendToInput

      public static void appendToInput(AuditInput auditInput, String tableName, Integer recordId, Map<String,Serializable> securityKeyValues, String message)
      Add 1 auditSingleInput to an AuditInput object - with no details (child records).
    • appendToInput

      public static AuditInput appendToInput(AuditInput auditInput, String tableName, Integer recordId, Map<String,Serializable> securityKeyValues, String message, List<QRecord> details)
      Add 1 auditSingleInput to an AuditInput object - with a list of details (child records).
    • getRecordSecurityKeyValues

      public static Map<String,Serializable> getRecordSecurityKeyValues(QTableMetaData table, QRecord record, Optional<QRecord> oldRecord)
      For a given record, from a given table, build a map of the record's security key values. If, in case, the record has null value(s), and the oldRecord is given (e.g., for the case of an update, where the record may not have all fields set, and oldRecord should be known for doing field-diffs), then try to get the value(s) from oldRecord. Currently, will leave values null if they aren't found after that. An alternative could be to re-fetch the record from its source if needed...
    • execute

      public AuditOutput execute(AuditInput input)
      Specified by:
      execute in class AbstractQActionFunction<AuditInput,AuditOutput>