com.kenshoo.pl.entity.annotation.audit.Audited Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.entity.annotation.audit;
import com.kenshoo.pl.entity.audit.AuditTrigger;
import com.kenshoo.pl.entity.spi.audit.AuditExtensions;
import com.kenshoo.pl.entity.spi.audit.AuditExtensions.EmptyAuditExtensions;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static com.kenshoo.pl.entity.audit.AuditTrigger.ON_CREATE_OR_UPDATE;
/**
* Whenever an entity or field has this annotation, it indicates that any changes to the entity / field
* will be published (by the publisher belonging to the PersistenceLayer instance).
* When the entity-level is annotated, it implies that all fields should also be annotated unless overriden by {@link NotAudited} on the field.
*/
@Target({ElementType.TYPE, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Audited {
/**
* @return the rule by which to trigger auditing for the annotated entity type or field.
* This attribute is valid for field-level annotations only, and will be ignored if appearing on entities.
* For the entity-level,{@link AuditTrigger#ON_CREATE_OR_UPDATE} is implied always.
*/
AuditTrigger trigger() default ON_CREATE_OR_UPDATE;
/**
* NOTE: This attribute is valid for entity-level annotations only, and will be ignored if appearing on fields.
* @return extensions to the basic audit data that will be generated for the annotated entity type.
* This attribute is valid for entity-level annotations only, and will be ignored if appearing on fields.
* @see AuditExtensions
*/
Class extends AuditExtensions> extensions() default EmptyAuditExtensions.class;
}