public final class Entities
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
ENTITY_GROUP_METADATA_ID
ID for __entity_group__ entities.
|
static java.lang.String |
ENTITY_GROUP_METADATA_KIND
A metadata kind that can be used to get information about entity groups.
|
static java.lang.String |
KIND_METADATA_KIND
A metadata kind that can be used to query for kinds that exist in the
datastore.
|
static long |
NAMESPACE_METADATA_EMPTY_ID
The numeric ID for __namespace__ keys representing the empty namespace.
|
static java.lang.String |
NAMESPACE_METADATA_KIND
A metadata kind that can be used to query for namespaces that exist in the
datastore.
|
static java.lang.String |
PROPERTY_METADATA_KIND
A metadata kind that can be used to query for properties that exist in the
datastore.
|
Constructor and Description |
---|
Entities() |
Modifier and Type | Method and Description |
---|---|
static Key |
createEntityGroupKey(Key key)
Create an __entity_group__ key for the entity group containing
key . |
static Key |
createKindKey(java.lang.String kind)
Create a __kind__ key for
kind . |
static Key |
createNamespaceKey(java.lang.String namespace)
Create a __namespace__ key for
namespace . |
static Key |
createPropertyKey(java.lang.String kind,
java.lang.String property)
Create a __property__ key for
property of kind . |
static java.lang.String |
getNamespaceFromNamespaceKey(Key namespaceKey)
Extract the namespace name from a __namespace__ key.
|
static long |
getVersionProperty(Entity entity)
Get the value of the __version__ property from
entity . |
public static final java.lang.String KIND_METADATA_KIND
public static final java.lang.String PROPERTY_METADATA_KIND
public static final java.lang.String NAMESPACE_METADATA_KIND
public static final long NAMESPACE_METADATA_EMPTY_ID
public static final java.lang.String ENTITY_GROUP_METADATA_KIND
DatastoreService.get(com.google.appengine.api.datastore.Key)
call on key
KeyFactory.createKey(R, ENTITY_GROUP_METADATA_KIND,
ENTITY_GROUP_METADATA_ID)
.
The resulting entity has a Entity.VERSION_RESERVED_PROPERTY
numeric property whose value is guaranteed to increase on every change to
the entity group. This value may also occasionally increase without any
user-visible change to the entity group.
public static final long ENTITY_GROUP_METADATA_ID
ENTITY_GROUP_METADATA_KIND
,
Constant Field Valuespublic static Key createKindKey(java.lang.String kind)
kind
.kind
- Kind to create key for.public static Key createPropertyKey(java.lang.String kind, java.lang.String property)
property
of kind
.kind
- Kind to create key for.property
- Property to create key for.public static Key createNamespaceKey(java.lang.String namespace)
namespace
.namespace
- Namespace to create key for.public static java.lang.String getNamespaceFromNamespaceKey(Key namespaceKey)
namespaceKey
- Key to extract namespace from.public static Key createEntityGroupKey(Key key)
key
.key
- Key of any entity in the entity group.public static long getVersionProperty(Entity entity)
entity
.entity
- Entity to fetch __version__ from (must have a numeric
__version__ property).