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

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

Go to download

*** THIS VERSION UPLOADED FOR USE WITH CEDAR-COMMON, TO AVOID DEPENDENCIES ON GOOGLE CODE-BASED MAVEN REPOSITORIES. *** The simplest convenient interface to the Google App Engine datastore

The newest version!
package com.googlecode.objectify.annotation;

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

/**
 * 

Annotation which helps migrate schemas by loading one of several possible properties * in the entity into fields or methods. This is typically used when a field is renamed, * allowing the field to be populated by both its current name and any prior names.

* *
    *
  • When placed on a field, the additional names (entity properties) will be checked * when this field is loaded. If the entity contains data for more than one of the names, * an exception will be thrown. *
  • When placed on a parameter to a method that takes a single parameter, the method * will be called with the data value. As with fields, any ambiguity in the data (multiple * properties that would cause the method to be called) will produce an exception. However, * {@code @AlsoLoad} on a method parameter *can* be used to override field names and "steal" the * value that would otherwise have been set on a field. This can be useful when changing the * type of a field.
  • *
* * @author Jeff Schnitzer */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) public @interface AlsoLoad { String[] value(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy