com.google.appengine.api.datastore
Class Entities
- java.lang.Object
-
- com.google.appengine.api.datastore.Entities
-
public final class Entities extends java.lang.Object
Utility functions and constants for entities.
-
-
Field Summary
Fields 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 Summary
Constructors Constructor and Description Entities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Key
createEntityGroupKey(Key key)
Create an __entity_group__ key for the entity group containingkey
.static Key
createKindKey(java.lang.String kind)
Create a __kind__ key forkind
.static Key
createNamespaceKey(java.lang.String namespace)
Create a __namespace__ key fornamespace
.static Key
createPropertyKey(java.lang.String kind, java.lang.String property)
Create a __property__ key forproperty
ofkind
.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 fromentity
.
-
-
-
Field Detail
-
KIND_METADATA_KIND
public static final java.lang.String KIND_METADATA_KIND
A metadata kind that can be used to query for kinds that exist in the datastore.- See Also:
- Constant Field Values
-
PROPERTY_METADATA_KIND
public static final java.lang.String PROPERTY_METADATA_KIND
A metadata kind that can be used to query for properties that exist in the datastore.- See Also:
- Constant Field Values
-
NAMESPACE_METADATA_KIND
public static final java.lang.String NAMESPACE_METADATA_KIND
A metadata kind that can be used to query for namespaces that exist in the datastore.- See Also:
- Constant Field Values
-
NAMESPACE_METADATA_EMPTY_ID
public static final long NAMESPACE_METADATA_EMPTY_ID
The numeric ID for __namespace__ keys representing the empty namespace.- See Also:
- Constant Field Values
-
ENTITY_GROUP_METADATA_KIND
public static final java.lang.String ENTITY_GROUP_METADATA_KIND
A metadata kind that can be used to get information about entity groups. The metadata for the entity group with root entity key R is fetched using aDatastoreService.get(com.google.appengine.api.datastore.Key)
call on keyKeyFactory.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.- See Also:
- Constant Field Values
-
ENTITY_GROUP_METADATA_ID
public static final long ENTITY_GROUP_METADATA_ID
ID for __entity_group__ entities.- See Also:
ENTITY_GROUP_METADATA_KIND
, Constant Field Values
-
-
Method Detail
-
createKindKey
public static Key createKindKey(java.lang.String kind)
Create a __kind__ key forkind
.- Parameters:
kind
- Kind to create key for.- Returns:
- __kind__ key.
-
createPropertyKey
public static Key createPropertyKey(java.lang.String kind, java.lang.String property)
Create a __property__ key forproperty
ofkind
.- Parameters:
kind
- Kind to create key for.property
- Property to create key for.- Returns:
- __property__ key.
-
createNamespaceKey
public static Key createNamespaceKey(java.lang.String namespace)
Create a __namespace__ key fornamespace
.- Parameters:
namespace
- Namespace to create key for.- Returns:
- __namespace__ key.
-
getNamespaceFromNamespaceKey
public static java.lang.String getNamespaceFromNamespaceKey(Key namespaceKey)
Extract the namespace name from a __namespace__ key.- Parameters:
namespaceKey
- Key to extract namespace from.- Returns:
- The namespace name.
-
createEntityGroupKey
public static Key createEntityGroupKey(Key key)
Create an __entity_group__ key for the entity group containingkey
.- Parameters:
key
- Key of any entity in the entity group.- Returns:
- __entity_group__ key.
-
getVersionProperty
public static long getVersionProperty(Entity entity)
Get the value of the __version__ property fromentity
.- Parameters:
entity
- Entity to fetch __version__ from (must have a numeric __version__ property).- Returns:
- __version__ property value.
-
-