public class ConcreteEntityMetadata<T> extends Object implements EntityMetadata<T>
Modifier and Type | Field and Description |
---|---|
protected Cache |
cached
The cached annotation, or null if entity should not be cached
|
protected Class<T> |
entityClass |
protected ObjectifyFactory |
fact |
protected List<Method> |
onLoadMethods
Any methods in the hierarchy annotated with @OnLoad, could be null
|
protected List<Method> |
onSaveMethods
Any methods in the hierarchy annotated with @OnSave, could be null
|
protected Transmog<T> |
transmog
For translating between pojos and entities
|
Constructor and Description |
---|
ConcreteEntityMetadata(ObjectifyFactory fact,
Class<T> clazz)
Inspects and stores the metadata for a particular entity class.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Transmog<T> |
getTransmog()
Just for testing purposes; not part of the EntityMetadata interface
|
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.
|
protected ObjectifyFactory fact
protected List<Method> onSaveMethods
protected List<Method> onLoadMethods
protected Cache cached
public ConcreteEntityMetadata(ObjectifyFactory fact, Class<T> clazz)
clazz
- must be a properly-annotated Objectify entity class.public 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 Class<T> getEntityClass()
EntityMetadata
getEntityClass
in interface EntityMetadata<T>
public KeyMetadata<T> getKeyMetadata()
EntityMetadata
getKeyMetadata
in interface EntityMetadata<T>
Copyright © 2014. All rights reserved.