|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.objectify.impl.ConcreteEntityMetadata<T>
public class ConcreteEntityMetadata<T>
Knows how to map between datastore Entity objects and your typed POJO objects. An instance of this class knows how to perform mapping of a specific subclass.
Field Summary | |
---|---|
protected Cached |
cached
The cached annotation, or null if entity should not be cached |
protected java.lang.Class<T> |
entityClass
|
protected java.lang.reflect.Constructor<T> |
entityClassConstructor
|
protected java.lang.reflect.Field |
idField
We treat the @Id key field specially - it will be either Long id or String name |
protected java.lang.String |
kind
The kind that is associated with the class, ala ObjectifyFactory.getKind(Class>) |
protected java.lang.reflect.Field |
nameField
|
protected java.lang.reflect.Field |
parentField
If the entity has a @Parent field, treat it specially |
protected java.util.List<java.lang.reflect.Method> |
postLoadMethods
Any methods in the hierarchy annotated with @PostLoad, could be null |
protected java.util.List<java.lang.reflect.Method> |
prePersistMethods
Any methods in the hierarchy annotated with @PrePersist, could be null |
protected Transmog<T> |
transmog
For translating between pojos and entities |
Constructor Summary | |
---|---|
ConcreteEntityMetadata(Conversions conversions,
java.lang.Class<T> clazz)
Inspects and stores the metadata for a particular entity class. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Class<T> entityClass
protected java.lang.reflect.Constructor<T> entityClassConstructor
protected java.lang.String kind
protected java.lang.reflect.Field idField
protected java.lang.reflect.Field nameField
protected java.lang.reflect.Field parentField
protected java.util.List<java.lang.reflect.Method> prePersistMethods
protected java.util.List<java.lang.reflect.Method> postLoadMethods
protected Transmog<T> transmog
protected Cached cached
Constructor Detail |
---|
public ConcreteEntityMetadata(Conversions conversions, java.lang.Class<T> clazz)
clazz
- must be a properly-annotated Objectify entity class.Method Detail |
---|
public 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 |