public final class EmbeddedEntity extends PropertyContainer
Key).
This class is similar to Entity, but differs in the following ways:
equals(Object) and hashCode() compare the embedded properties in addition
to the Key.
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:
EmbeddedEntity sv = new EmbeddedEntity();
sv.setKey(entity.getKey())
sv.setPropertiesFrom(entity)
To convert to an Entity use:
Entity entity = new Entity(sv.getKey())
entity.setPropertiesFrom(sv);
| Constructor and Description |
|---|
EmbeddedEntity() |
| Modifier and Type | Method and Description |
|---|---|
EmbeddedEntity |
clone() |
boolean |
equals(java.lang.Object obj) |
Key |
getKey() |
int |
hashCode() |
void |
setKey(Key key) |
java.lang.String |
toString() |
getProperties, getProperty, hasProperty, isUnindexedProperty, removeProperty, setIndexedProperty, setPropertiesFrom, setProperty, setUnindexedPropertypublic Key getKey()
null.public void setKey(Key key)
key - the key to setpublic EmbeddedEntity clone()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object