org.javers.core.metamodel.annotation.ShallowReference 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 ShallowReference
to mark certain Entities as compared only by Id.
*
*
* When ShallowReference
is enabled for a given Entity,
* all its properties (except idProperty) are ignored.
*
*
* ShallowReference
annotation can be used both globally, on the class-level, for example:
*
*
* @ShallowReference
* class Entity {
* @Id String id;
* ...
* }
*
*
* and locally, on the property-level, for example:
*
*
* class Entity {
* @Id String id;
* ...
* }
*
* class AnotherEntity {
* @Id String id;
* @ShallowReference Entity shallowReference;
* @ShallowReference List<Entity> shallowReferences;
* Entity regularReference;
* ...
* }
*
*
* @author akrystian
*/
@Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
public @interface ShallowReference {
}