public interface ObjectToKeyFactory
Modifier and Type | Method and Description |
---|---|
Key |
allocateKeyForObject(Object entity,
DatastorePersistentEntity datastorePersistentEntity,
Key... ancestors)
Allocates a new ID
Key for the given entity object and sets the allocated ID value in
the object. |
IncompleteKey |
getIncompleteKey(String kindName)
Get an
IncompleteKey (a Key without ID part) from a kind name. |
Key |
getKeyFromId(Object id,
String kindName)
Get a
Key from a provided ID value and a kind name. |
Key |
getKeyFromObject(Object entity,
DatastorePersistentEntity datastorePersistentEntity)
Get a
Key from an entity. |
IncompleteKey getIncompleteKey(String kindName)
IncompleteKey
(a Key without ID part) from a kind name.kindName
- the kind nameKey getKeyFromId(Object id, String kindName)
Key
from a provided ID value and a kind name. If the given ID value is already a
Key then this is the Key returned. Otherwise a Key is created with the given kind name and the
given ID value as the only and root value.id
- the ID value that can be the root single ID value or a fully formed Key.kindName
- the kind name used if the ID value provided is not a fully formed Key.Key getKeyFromObject(Object entity, DatastorePersistentEntity datastorePersistentEntity)
Key
from an entity.entity
- the entity that whose ID value we want to form into a Key.datastorePersistentEntity
- the metadata of the given entity.Key allocateKeyForObject(Object entity, DatastorePersistentEntity datastorePersistentEntity, Key... ancestors)
Key
for the given entity object and sets the allocated ID value in
the object. Only Key ids are allowed in entities if ancestors are present.entity
- the object for which to get and set the ID value.datastorePersistentEntity
- the persistent entity metadata for the entity object.ancestors
- ancestors that should be added to the entityCopyright © 2022. All rights reserved.