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

com.googlecode.objectify.annotation.IgnoreSave Maven / Gradle / Ivy

There is a newer version: 6.1.2
Show newest version
package com.googlecode.objectify.annotation;

import com.googlecode.objectify.condition.If;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 

When placed on an entity field, the field will not be written to the datastore. * It will, however, be loaded normally. This is particularly useful in concert with * {@code @OnLoad} and {@code @OnSave} to transform your data.

* *

If passed one or more classes that implement the {@code If} interface, the * value will be ignored only if it tests positive for any of the conditions. This * is a convenient way to prevent storing of default values, potentially saving * a significant amount of storage and indexing cost.

* * @author Jeff Schnitzer */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD}) public @interface IgnoreSave { // Fully specifying the default value works around a bizarre compiler bug: // http://stackoverflow.com/questions/1425088/incompatible-types-found-required-default-enums-in-annotations Class>[] value() default { com.googlecode.objectify.condition.Always.class }; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy