Class EmbeddedEntity
- java.lang.Object
-
- com.google.appengine.api.datastore.PropertyContainer
-
- com.google.appengine.api.datastore.EmbeddedEntity
-
- All Implemented Interfaces:
Serializable
,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
Key
is optional. Keys
without 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).
Entity
use:
To convert to anEmbeddedEntity sv = new EmbeddedEntity(); sv.setKey(entity.getKey()) sv.setPropertiesFrom(entity)
Entity
use:Entity entity = new Entity(sv.getKey()) entity.setPropertiesFrom(sv);
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EmbeddedEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmbeddedEntity
clone()
boolean
equals(@Nullable Object obj)
@Nullable Key
getKey()
Returns the key ornull
.int
hashCode()
void
setKey(@Nullable Key key)
String
toString()
-
Methods inherited from class com.google.appengine.api.datastore.PropertyContainer
getProperties, getProperty, hasProperty, isUnindexedProperty, removeProperty, setIndexedProperty, setPropertiesFrom, setProperty, setUnindexedProperty
-
-
-
-
Method Detail
-
getKey
public @Nullable Key getKey()
Returns the key ornull
.
-
setKey
public void setKey(@Nullable Key key)
- Parameters:
key
- the key to set
-
clone
public EmbeddedEntity clone()
-
-