com.googlecode.objectify.annotation.IgnoreSave Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectify Show documentation
Show all versions of objectify Show documentation
The simplest convenient interface to the Google App Engine datastore
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 extends If, ?>>[] value() default { com.googlecode.objectify.condition.Always.class };
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy