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 Details

    • EntityMetadata

      public EntityMetadata(ObjectifyFactory fact, Class<P> clazz)
      Parameters:
      clazz - must have @Entity in its hierarchy
  • Method Details

    • getCacheExpirySeconds

      public Integer 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

      public P load(com.google.appengine.api.datastore.Entity ent, LoadContext ctx)
      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

      public com.google.appengine.api.datastore.Entity save(P pojo, SaveContext ctx)
      Converts an object to a datastore Entity with the appropriate Key type.
    • getEntityClass

      public Class<P> getEntityClass()
      Gets the class associated with this entity.
    • getKeyMetadata

      public KeyMetadata<P> getKeyMetadata()
      Get specific metadata about the key for this type.
    • getTranslator

      public Translator<P,​com.google.appengine.api.datastore.PropertyContainer> getTranslator()
      = * @return the translator that will convert between native datastore representation and pojo for this type.