@Override
    public List<? extends AuditActionContext> getAuditRecords(final Map<WhereClauseFields, Object> whereClause) {
        val builder = new StringBuilder("1=1 ");
        val args = new ArrayList<>();
        if (whereClause.containsKey(WhereClauseFields.DATE)) {
            builder.append("AND AUD_DATE>=? ");
            var sinceDate = (TemporalAccessor) whereClause.get(WhereClauseFields.DATE);
            if (dateFormatterFunction != null) {
                val formatter = DateTimeFormatter.ofPattern(dateFormatterPattern, Locale.ENGLISH);
                val patternToUse = StringUtils.isNotBlank(dateFormatterPattern) ? dateFormatterPattern : "yyyy-MM-dd";
                val formattedDate = String.format(dateFormatterFunction, formatter.format(sinceDate), patternToUse);
                LOGGER.trace("Using date formatter [{}] to format date [{}] to [{}]", dateFormatterFunction, sinceDate, formattedDate);
                args.add(formattedDate);
            } else {
                args.add(sinceDate);
            }
        }
        if (whereClause.containsKey(WhereClauseFields.PRINCIPAL)) {
            var principal = whereClause.get(WhereClauseFields.PRINCIPAL).toString();
            args.add(principal);
            builder.append("AND AUD_USER=? ");
        }
        val count = whereClause.containsKey(WhereClauseFields.COUNT)
            ? (long) whereClause.get(WhereClauseFields.COUNT)
            : DEFAULT_MAX_AUDIT_RECORDS_TO_FETCH;

        return getAuditRecordsSince(builder, args.toArray(), count);
    }
Instance of TransactionTemplate to manually execute a transaction since
threads are not in the same transaction.
support/cas-server-support-audit-jdbc/src/main/java/org/apereo/inspektr/audit/support/JdbcAuditTrailManager.java