org.javers.core.metamodel.annotation.IgnoreDeclaredProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javers-core Show documentation
Show all versions of javers-core Show documentation
JaVers - object auditing and diff framework for Java
package org.javers.core.metamodel.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Use IgnoreDeclaredProperties annotation to mark
* all properties declared in a given class as ignored by JaVers.
*
*
* JaVers still tracks instances of a given class and tracks changes done on properties of
* its superclass
* (by contrast, if a class is annotated with {@link DiffIgnore}, JaVers completely ignores instances of
* that class).
*
*
* For example, when you want to ignore all properties declared in a subclass B but
* still track changes in properties declared in a superclass A:
*
* class A {
* @Id
* private Long id;
* private String name;
* }
*
*
* this mapping:
*
* @IgnoreDeclaredProperties
* class B extends A {
* private String foo;
* private String bar;
* }
*
*
* is equivalent to:
*
* class B extends A {
* @DiffIgnore
* private String foo;
* @DiffIgnore
* private String bar;
* }
*
*
* @see DiffIgnore
* @author Edward Mallia
*/
@Target({ TYPE})
@Retention(RUNTIME)
public @interface IgnoreDeclaredProperties {
}