package com.arangodb.springframework.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.annotation.Reference;
/**
* Annotation to indicate that the annotated field is stored as a document in
* another collection instead of a nested document. The document {@literal _id}
* of that document is stored as a reference in the stored field.
*
* @author Mark Vollmary
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD })
@Reference
public @interface Ref {
/**
* Whether the entity should be loaded lazily
*/
boolean lazy() default false;
}
1条答案
按热度按时间92dk7w1h1#
从
arangodb-spring-data 3.2.5
开始,引用对象的默认获取应该是急切的,正如您在@Ref
注解类中看到的那样。Ref.class
要使引用的数据延迟加载,应使用