Skip to content

Commit

Permalink
#2349 Disable verification and registration of audit types by annotat…
Browse files Browse the repository at this point in the history
…ion processors

Audit types are registered dynamically. The verifier operates with
static properties of the program, therefore it will report errors on
audit types due to the use of unregistered entities as property types
(e.g, `auditEntity` in audit-prop types and `changedProps` in
audit-entity types).
  • Loading branch information
homedirectory committed Dec 13, 2024
1 parent 1472687 commit 527b75d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import com.google.common.collect.Streams;
import com.squareup.javapoet.*;
import jakarta.inject.Inject;
import ua.com.fielden.platform.annotations.appdomain.SkipEntityRegistration;
import ua.com.fielden.platform.entity.AbstractEntity;
import ua.com.fielden.platform.entity.annotation.*;
import ua.com.fielden.platform.entity.exceptions.InvalidArgumentException;
import ua.com.fielden.platform.entity.meta.PropertyDescriptor;
import ua.com.fielden.platform.entity.validation.annotation.Final;
import ua.com.fielden.platform.meta.IDomainMetadata;
import ua.com.fielden.platform.meta.PropertyMetadata;
import ua.com.fielden.platform.processors.verify.annotation.SkipVerification;
import ua.com.fielden.platform.reflection.TitlesDescsGetter;

import java.io.IOException;
Expand Down Expand Up @@ -131,6 +133,8 @@ private JavaFile generateAuditEntity(
final var a3tBuilder = new AuditEntityBuilder(auditTypeClassName, type, auditTypeVersion);

a3tBuilder.addAnnotation(AnnotationSpecs.entityTitle("%s Audit".formatted(TitlesDescsGetter.getEntityTitle(type))));
a3tBuilder.addAnnotation(javaPoet.getAnnotation(SkipVerification.class));
a3tBuilder.addAnnotation(javaPoet.getAnnotation(SkipEntityRegistration.class));

// Property for the reference to the audited entity.
// By virtue of its name, this property's accessor and setter implement abstract methods in the base type
Expand Down Expand Up @@ -331,7 +335,10 @@ private JavaFile generateAuditPropEntity(
.addAnnotation(AnnotationSpecs.keyTitle("%s Audit and Changed Property".formatted(auditedEntityTitle)))
.addAnnotation(javaPoet.getAnnotation(MapEntityTo.class))
.addAnnotation(AnnotationSpecs.auditPropFor(auditEntityClassName))
.addAnnotation(javaPoet.getAnnotation(CompanionIsGenerated.class));
.addAnnotation(javaPoet.getAnnotation(CompanionIsGenerated.class))
.addAnnotation(javaPoet.getAnnotation(SkipVerification.class))
.addAnnotation(javaPoet.getAnnotation(SkipEntityRegistration.class))
;

// By virtue of its name, this property's accessor and setter implement abstract methods in the base type
final var auditEntityProp = propertyBuilder(AUDIT_ENTITY, auditEntityClassName)
Expand Down

0 comments on commit 527b75d

Please sign in to comment.