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
,
setPropertiesFrom
,
setProperty
,
setUnindexedProperty
public Key getKey()
null
.
public void setKey(Key key)
key
- the key to set
public EmbeddedEntity clone()
public java.lang.String toString()
toString
in class
java.lang.Object
public int hashCode()
hashCode
in class
java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class
java.lang.Object