use of com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordReferenceValueType in project midpoint by Evolveum.
the class AuditInsertion method insertReferences.
private void insertReferences(MAuditEventRecord auditRow, List<AuditEventRecordReferenceType> references) {
if (references.isEmpty()) {
return;
}
QAuditRefValue qr = QAuditRefValueMapping.get().defaultAlias();
SQLInsertClause insertBatch = jdbcSession.newInsert(qr);
for (AuditEventRecordReferenceType refSet : references) {
for (AuditEventRecordReferenceValueType refValue : refSet.getValue()) {
// id will be generated, but we're not interested in those here
PolyStringType targetName = refValue.getTargetName();
insertBatch.set(qr.recordId, auditRow.id).set(qr.timestamp, auditRow.timestamp).set(qr.name, refSet.getName()).set(qr.targetOid, SqaleUtils.oidToUUid(refValue.getOid())).set(qr.targetType, refValue.getType() != null ? MObjectType.fromTypeQName(refValue.getType()) : null).set(qr.targetNameOrig, PolyString.getOrig(targetName)).set(qr.targetNameNorm, PolyString.getNorm(targetName)).addBatch();
}
}
if (insertBatch.getBatchCount() == 0) {
// strange, no values anywhere?
return;
}
insertBatch.setBatchToBulk(true);
insertBatch.execute();
}
use of com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordReferenceValueType in project midpoint by Evolveum.
the class AuditReferenceValue method toXml.
public AuditEventRecordReferenceValueType toXml() {
AuditEventRecordReferenceValueType rv = new AuditEventRecordReferenceValueType();
rv.setOid(oid);
rv.setType(type);
rv.setTargetName(PolyString.toPolyStringType(targetName));
return rv;
}
Aggregations