Package com.googlecode.objectify.impl
Class EntityMetadata<P>
java.lang.Object
com.googlecode.objectify.impl.EntityMetadata<P>
public class EntityMetadata<P> extends Object
Holds basic information about POJO entities, and can translate back and forth to the
datastore representation.
- Author:
- Jeff Schnitzer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the expiry associated with this kind, defined by the @Cached annotation.Gets the class associated with this entity.Get specific metadata about the key for this type.Translator<P,com.google.appengine.api.datastore.PropertyContainer>
= * @return the translator that will convert between native datastore representation and pojo for this type.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(P pojo, SaveContext ctx)
Converts an object to a datastore Entity with the appropriate Key type.
-
Constructor Details
-
EntityMetadata
- Parameters:
clazz
- must have @Entity in its hierarchy
-
-
Method Details
-
getCacheExpirySeconds
Get the expiry associated with this kind, defined by the @Cached annotation. For polymorphic types, this is always the instruction on the root @Entity - you cannot provide per-type caching.- Returns:
- null means DO NOT CACHE, 0 means "no limit", otherwise # of seconds
-
load
Converts an entity to an object of the appropriate type for this metadata structure. Does not check that the entity is appropriate; that should be done when choosing which EntityMetadata to call. -
save
Converts an object to a datastore Entity with the appropriate Key type. -
getEntityClass
Gets the class associated with this entity. -
getKeyMetadata
Get specific metadata about the key for this type. -
getTranslator
= * @return the translator that will convert between native datastore representation and pojo for this type.
-