|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityMetadata<T>
The interface by which POJOs and datastore Entity objects are translated back and forth. Subclasses implement specific mapping, including polymorphic mapping.
Method Summary | |
---|---|
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. |
Method Detail |
---|
java.lang.String getKind()
java.lang.Integer getCacheExpirySeconds()
T toObject(com.google.appengine.api.datastore.Entity ent, Objectify ofy)
com.google.appengine.api.datastore.Entity toEntity(T pojo, Objectify ofy)
void setKey(T obj, com.google.appengine.api.datastore.Key key)
obj
- must be of the entityClass type for this metadata.com.google.appengine.api.datastore.Key getRawKey(java.lang.Object obj)
obj
- must be of the entityClass type for this metadata.
java.lang.IllegalArgumentException
- if obj has a null idboolean isIdField(java.lang.String propertyName)
boolean isNameField(java.lang.String propertyName)
boolean hasParentField()
java.lang.Class<T> getEntityClass()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |