All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javers.spring.annotation.JaversAuditableConditionalDelete Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
package org.javers.spring.annotation;

import org.javers.core.Javers;
import org.javers.spring.auditable.aspect.JaversAuditableAspect;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Enables auto-audit when put on a conditionally deleting method (typically on a Repository method).
 * 

* * The annotated method should return a deleted Entity or a collection of deleted Entities. *

* * Triggers {@link Javers#commitShallowDelete(String, Object)} on each returned Entity. *

* * Usage: * *
 * {@literal @}JaversAuditableConditionalDelete
 *  List<DummyEntity> deleteByName(String name) {
 *     ...
 *  }
 * 
* * or

* *
 *{@literal @}JaversAuditableConditionalDelete
 * DummyEntity deleteById(String id) {
 *    ...
 * }
 * 
* * @see JaversAuditableAspect */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface JaversAuditableConditionalDelete { }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy