com.github.aidensuen.mongo.annotation.Update Maven / Gradle / Ivy
package com.github.aidensuen.mongo.annotation;
import com.github.aidensuen.mongo.command.OperationType;
import org.springframework.core.annotation.AliasFor;
import java.lang.annotation.*;
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Update {
String method() default "dynamicCommand";
OperationType operationType() default OperationType.UNKNOWN;
/**
* class that determines the collection to use
*
* @return
*/
Class> entityClass() default Object.class;
/**
* the properties in entity, default update all properties
*
* @return
*/
@AliasFor("updateFields")
String[] value() default {};
/**
* the same as value
*
* @return
*/
@AliasFor("value")
String[] updateFields() default {};
/**
* when it's true, null value will be upsert
*
* @return
*/
boolean nullable() default false;
}