|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.objectify.impl.PolymorphicEntityMetadata<T>
public class PolymorphicEntityMetadata<T>
The interface by which POJOs and datastore Entity objects are translated back and forth. Subclasses implement specific mapping, including polymorphic mapping.
Field Summary | |
---|---|
static java.lang.String |
DISCRIMINATOR_INDEX_PROPERTY
Name of the list property which will hold all indexed discriminator values |
static java.lang.String |
DISCRIMINATOR_PROPERTY
Name of the out-of-band discriminator property in a raw Entity |
Constructor Summary | |
---|---|
PolymorphicEntityMetadata(java.lang.Class<T> clazz,
ConcreteEntityMetadata<T> baseMetadata)
Initializes this metadata structure with the specified class. |
Method Summary | ||
---|---|---|
|
addSubclass(java.lang.Class<S> clazz,
ConcreteEntityMetadata<S> subclassMeta)
Registers a @Subclass in a polymorphic hierarchy. |
|
java.lang.Integer |
getCacheExpirySeconds()
Get the expiry associated with this kind, defined by the @Cached annotation. |
|
java.lang.Class<T> |
getEntityClass()
Gets the class associated with this entity. |
|
java.lang.String |
getKind()
|
|
com.google.appengine.api.datastore.Key |
getRawKey(java.lang.Object obj)
Gets a key composed of the relevant id and parent fields in the object. |
|
boolean |
hasParentField()
|
|
boolean |
isIdField(java.lang.String propertyName)
|
|
boolean |
isNameField(java.lang.String propertyName)
|
|
void |
setKey(T obj,
com.google.appengine.api.datastore.Key key)
Sets the relevant id and parent fields of the object to the values stored in the key. |
|
com.google.appengine.api.datastore.Entity |
toEntity(T pojo,
Objectify ofy)
Converts an object to a datastore Entity with the appropriate Key type. |
|
T |
toObject(com.google.appengine.api.datastore.Entity ent,
Objectify ofy)
Converts an entity to an object of the appropriate type for this metadata structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DISCRIMINATOR_PROPERTY
public static final java.lang.String DISCRIMINATOR_INDEX_PROPERTY
Constructor Detail |
---|
public PolymorphicEntityMetadata(java.lang.Class<T> clazz, ConcreteEntityMetadata<T> baseMetadata)
baseMetadata
- is the metadata for the @Entity class that defines the kind of the hierarchyMethod Detail |
---|
public <S extends T> void addSubclass(java.lang.Class<S> clazz, ConcreteEntityMetadata<S> subclassMeta)
clazz
- must have the @Subclass annotationpublic java.lang.String getKind()
getKind
in interface EntityMetadata<T>
public java.lang.Integer getCacheExpirySeconds()
EntityMetadata
getCacheExpirySeconds
in interface EntityMetadata<T>
public T toObject(com.google.appengine.api.datastore.Entity ent, Objectify ofy)
EntityMetadata
toObject
in interface EntityMetadata<T>
public com.google.appengine.api.datastore.Entity toEntity(T pojo, Objectify ofy)
EntityMetadata
toEntity
in interface EntityMetadata<T>
public void setKey(T obj, com.google.appengine.api.datastore.Key key)
EntityMetadata
setKey
in interface EntityMetadata<T>
obj
- must be of the entityClass type for this metadata.public com.google.appengine.api.datastore.Key getRawKey(java.lang.Object obj)
EntityMetadata
getRawKey
in interface EntityMetadata<T>
obj
- must be of the entityClass type for this metadata.public boolean isIdField(java.lang.String propertyName)
isIdField
in interface EntityMetadata<T>
public boolean isNameField(java.lang.String propertyName)
isNameField
in interface EntityMetadata<T>
public boolean hasParentField()
hasParentField
in interface EntityMetadata<T>
public java.lang.Class<T> getEntityClass()
EntityMetadata
getEntityClass
in interface EntityMetadata<T>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |