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

org.javers.core.metamodel.annotation.ShallowReference Maven / Gradle / Ivy

There is a newer version: 7.6.2
Show newest version
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 { }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy