com.google.appengine.api.datastore
Class EmbeddedEntity
- java.lang.Object
-
- com.google.appengine.api.datastore.PropertyContainer
-
- com.google.appengine.api.datastore.EmbeddedEntity
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public final class EmbeddedEntity extends PropertyContainer
A property value containing embedded entity properties (and optionally aKey).This class is similar to
Entity, but differs in the following ways:equals(Object)andhashCode()compare the embedded properties in addition to theKey.- It is not queryable when stored in the datastore.
- A
Keyis optional. Keyswithout a name or id are considered equal if all other aspects of the keys are equal (as they will not be assigned IDs by the datastore when embedded).
Entityuse: To convert to anEmbeddedEntity sv = new EmbeddedEntity(); sv.setKey(entity.getKey()) sv.setPropertiesFrom(entity)Entityuse:Entity entity = new Entity(sv.getKey()) entity.setPropertiesFrom(sv);- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description EmbeddedEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description EmbeddedEntityclone()booleanequals(java.lang.Object obj)KeygetKey()inthashCode()voidsetKey(Key key)java.lang.StringtoString()-
Methods inherited from class com.google.appengine.api.datastore.PropertyContainer
getProperties, getProperty, hasProperty, isUnindexedProperty, removeProperty, setIndexedProperty, setPropertiesFrom, setProperty, setUnindexedProperty
-
-
-
-
Method Detail
-
getKey
public Key getKey()
- Returns:
- the key or
null.
-
setKey
public void setKey(Key key)
- Parameters:
key- the key to set
-
clone
public EmbeddedEntity clone()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-