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

org.loom.appengine.annotations.RootKey Maven / Gradle / Ivy

The newest version!
package org.loom.appengine.annotations;

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

/**
 * Tags a key attribute or parameter as a root entity one,
 * so just the Base58 ID value can be used instead of the full serialized key
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Documented
public @interface RootKey {
	
	/**
	 * The persistent class to be used for deserializing. The unqualified
	 * class name will be used for creating the key
	 */
	Class value();
	
	/** 
	 * The key type. Defaults to id
	 */
	RootKeyType type() default RootKeyType.ID;
	
	public enum RootKeyType {
		
		/** use the key id */
		ID, 
		
		/** use the key name */
		NAME
		
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy