public class PolymorphicEntityMetadata<T> extends Object implements EntityMetadata<T>
Modifier and Type | Field and Description |
---|---|
static String |
DISCRIMINATOR_INDEX_PROPERTY
Name of the list property which will hold all indexed discriminator values
|
static String |
DISCRIMINATOR_PROPERTY
Name of the out-of-band discriminator property in a raw Entity
|
Constructor and Description |
---|
PolymorphicEntityMetadata(Class<T> clazz,
ConcreteEntityMetadata<T> baseMetadata)
Initializes this metadata structure with the specified class.
|
Modifier and Type | Method and Description |
---|---|
<S extends T> |
addSubclass(Class<S> clazz,
ConcreteEntityMetadata<S> subclassMeta)
Registers an @EntitySubclass in a polymorphic hierarchy.
|
Integer |
getCacheExpirySeconds()
Get the expiry associated with this kind, defined by the @Cached annotation.
|
Class<T> |
getEntityClass()
Gets the class associated with this entity.
|
KeyMetadata<T> |
getKeyMetadata()
Get specific metadata about the key for this type.
|
T |
load(com.google.appengine.api.datastore.Entity ent,
LoadContext ctx)
Converts an entity to an object of the appropriate type for this metadata structure.
|
com.google.appengine.api.datastore.Entity |
save(T pojo,
SaveContext ctx)
Converts an object to a datastore Entity with the appropriate Key type.
|
public static final String DISCRIMINATOR_PROPERTY
public static final String DISCRIMINATOR_INDEX_PROPERTY
public PolymorphicEntityMetadata(Class<T> clazz, ConcreteEntityMetadata<T> baseMetadata)
baseMetadata
- is the metadata for the @Entity class that defines the kind of the hierarchypublic <S extends T> void addSubclass(Class<S> clazz, ConcreteEntityMetadata<S> subclassMeta)
clazz
- must have the @EntitySubclass annotationpublic Integer getCacheExpirySeconds()
EntityMetadata
getCacheExpirySeconds
in interface EntityMetadata<T>
public T load(com.google.appengine.api.datastore.Entity ent, LoadContext ctx)
EntityMetadata
load
in interface EntityMetadata<T>
public com.google.appengine.api.datastore.Entity save(T pojo, SaveContext ctx)
EntityMetadata
save
in interface EntityMetadata<T>
public KeyMetadata<T> getKeyMetadata()
EntityMetadata
getKeyMetadata
in interface EntityMetadata<T>
public Class<T> getEntityClass()
EntityMetadata
getEntityClass
in interface EntityMetadata<T>
Copyright © 2013. All Rights Reserved.